how to use git diff

git diff

Dùng để so sánh file trong vùng Working và vùng Staging


git diff --cached 

dùng lệnh này để so sánh sự thay đổi của file trong Staging và trong vùng Commited



git diff  HEAD 
so sánh file working và Commited



git diff  id_commit1 id_commit2

Dùng để show diff giữa 2 commit khác nhau



git diff  id_commit1 id_commit2   fileName

Dùng để show diff giữa 2 commit khác nhau của fileName



git diff branch1 branch2 ./diff_test.txt

Dùng để so sánh 2 file ở hai branch khác nhau





git diff --name-status SHA1 SHA2 [tên file]

cho thấy status của các file đã thay đổi từ 2 version trên

Comments

Popular posts from this blog

Fixing the DeepSpeed Import Error While Fine-Tuning the Qwen Model

Amazon Linux 2023 - User data configuration for launch templates to connect to the EKS cluster

How to create ISM policy and rotate logs in opensearch