简体   繁体   English

Git pull 不更新远程的最后一次提交

[英]Git pull not updating the last commit from remote

On the remote master, the repo has 3 commits ahead my local commit.在远程主机上,repo 在我的本地提交之前有 3 个提交。 I am trying to pull the latest commit.我正在尝试提取最新的提交。

$git checkout master
$git pull origin master
Current branch master is up to date.

then I have tried fetch然后我试过 fetch

$git fetch origin master:master
fatal: Refusing to fetch into current branch refs/heads/master of non-bare repository
fatal: the remote end hung up unexpectedly

I also tried reclone this repo, but I still lost last 3 commits.我也尝试重新克隆这个 repo,但我仍然丢失了最后 3 次提交。 Please let me know if you need provide any more information.如果您需要提供更多信息,请告诉我。 Thanks for helping.感谢您的帮助。

It works if you instead of如果你不是
$ git pull $ git拉
Type类型
$ git pull [remote] [local-branch> </code]Iit works if you instead of $ git pull [remote] [local-branch> </code]如果你不是
$ git pull $ git拉

$ git pull [remote] [local-branch> </code]

您可以粘贴 "git status" 、 "git log --graph --decorate --all" 的输出作为附加输入。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM