Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
287 views
in Technique[技术] by (71.8m points)

git log not tracking updates after git fetch (in --no-checkout clone)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You are using option

--no-checkout

This option implies no checkout of HEAD is performed after the clone is complete. So here you can see the current HEADs and tags.

I do not think without getting a working copy you can check all these details.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...