The git pull command is actually a sequence of two commands: fetch and merge .
fetch - gets updated pointers (i.e., branches - branch, and tags - tag) and downloads all the objects necessary for their (pointers) use (i.e., commits - commit, trees - tree and “blobs” - blob binary large object).
merge pointer - tries to “inject” a commit (and all interval commits) referenced by the pointer into your current branch (the branch in git is a floating pointer to the commit).
doing not pull , but only the first part - fetch :
$ git fetch
You will be able to see which commits are now separating your local pointer (for example, the master branch) from another pointer received from the remote repository (if only one is connected to the repository, the default is called origin ), for example, the master branch of the same name, which can be designated as origin/master :
$ git log master..origin/master
the two dots here are part of the syntax.
which changes occurred and in which files, you can see by adding the -p option to the log command:
$ git log -p master..origin/master
or you can see the complete list of differences in the files between the two pointers:
$ git diff master..origin/master
found a solution to view diff changes after fetch
git diff HEAD...origin/master
how competent is it?
fully qualified.
and fully corresponds to the output of git diff master..origin/master , if master is your current branch. You can specify with the help of the git status command, or more “low-level”, by looking into the contents of the .git/HEAD file. example:
$ cat .git/HEAD ref: refs/heads/master
here the HEAD pointer refers to the local master branch.
git logenough? - Sasha Chernykhgit diff master...origin/masterand the like - KoVadim