= using diff.tool =
setting:
git config --global diff.tool meld
remove interactive confirmation:
git config --global --add difftool.prompt false
cmd:
You use git difftool
in exactly the same way as you use git diff
. e.g.
git difftool <COMMIT_HASH> file_name git difftool <BRANCH_NAME> file_name
git difftool <COMMIT_HASH_1> <COMMIT_HASH_2> file_name
= diff file =
COPY
git diff commit_hash -- path/to/file
= diff local branches =
git diff branch_1..branch_2
= diff commits =
git diff k73ud^..dj374
to make sure to include all changes of k73ud
in the resulting diff.
git diff
compares two endpoints (instead of a commit range). Since the OP want to see the changes introduced by k73ud
, he/she needs to difference between the first parent commit of k73ud
: k73ud^
(or k73ud^1
or k73ud~
).
That way, the diff
results will include changes since k73ud
parent (meaning including changes from k73ud
itself), instead of changes introduced since k73ud
(up to dj374
).
Also you can try:
git diff oldCommit..newCommit git diff k73ud..dj374
and (1 space, not more):
git diff oldCommit newCommit git diff k73ud dj374
And if you need to get only files names (e.g. to copy hotfix them manually):
git diff k73ud dj374 --name-only
And you can get changes applied to another branch:
git diff k73ud dj374 > my.patch git apply my.patch
= diff local and remote branches: =
To update remote-tracking branches, you need to type git fetch
first and then :
git diff <masterbranch_path> <remotebranch_path>
You can git branch -a
to list all branches (local and remote) then choose branch name from list (just remove remotes/
from remote branch name.
Example: git diff master origin/master
(where "master" is local master branch and "origin/master" is a remote namely origin and master branch.)