Git: 'log master..origin / master' does not behave as expected

I am trying to compare my copy of 'master' with what is in the remote repository that it is tracking. I thought the next command would work, and often it seems. However, sometimes it doesn’t produce anything, and yet I know that the remote branch has a lot of changes, which I can confirm by pulling.

git log master..origin/master

Can someone explain this behavior and tell me which command should I use to determine the changes between local and remote?

[Another piece of data: It turned out that "git log master..origin / master" does not produce anything. Then I pull. The rush does not work because I have a working copy of some file. After that, "git log master..origin / master" shows me the differences. Does it seem attraction updated some local log? If so, how could I achieve this without doing (or trying to do) pull it out?]

+3
source share
3 answers

This is because it origin/masteris a remote branch in your repository. It represents where the initial branch of origin was the last time you “looked” (checked out, which is part of pull and remote update).

, , origin/master . , , .

git fetch --all git fetch origin .

+3
+1

, - ( ).

git pull:

  • ( )

, git log , ( fetch)

+1

Source: https://habr.com/ru/post/1737601/


All Articles