1

I have a few GIT repos that I mirrored locally to show up in my JIRA instance, but I have noticed some (to me) strange behaviour.

I have a repo, we will call this "myrepo". If I do a git clone, and git pull, I always get the most recent commits.

However, when I do a git clone --bare, when I do a "git fetch" from my bare repository, I do not get the newer commits showing up in my "git log".. Why is this?

4

1 回答 1

2

提取并没有移动你的头部。因此,日志仅向您显示 HEAD 在获取之前的历史记录。试试git log -all。这将向您显示所有分支的历史记录,包括您获取的远程分支。

git log remoteBranchName如果您知道您感兴趣的远程分支的名称,也可以使用。

如果您希望所有内容都与远程主服务器同步,您必须运行 git fetch, thengit merge或只是运行git pull,这与运行 fetch 和 merge 相同。如果您更喜欢特定的分支 - 例如。掌握 -git pull origin master

于 2011-09-30T20:11:56.517 回答