I have a git repository that I have cloned with git clone --no-checkout <url>
.
After fetching the changes from the remote repository, however, git log
does not show the latest commits. git log origin
does. I don't want any working files, so I don't want to merge or pull.
To reproduce, do a clone from an existing git repository. Then make (or wait for) some commits in the original repository (not the clone). Then go back to the clone and do git fetch
. Observe that git log
and git log origin
show a different set of commits.
How can I get git log
with no other arguments to show the latest commits instead of just the commits starting with the commit that was the latest when I did the original clone? It's not clear to me how to "advance the pointer" so that git log
shows the latest commits without checking out working files.
question from:
https://stackoverflow.com/questions/65865999/git-log-not-tracking-updates-after-git-fetch-in-no-checkout-clone 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…