如何解决GitHub的消息,说我当前分支的尖端及其远程副本的背后?(How do I resolve

2019-08-16 21:42发布

我想学习如何为我去使用GitHub上到版本控制我的工作。 (我单独工作,没有协作者,没有不同的分支,只是我备份我的工作,我去。)我在BitBucket.org设立私人Git仓库。 我使用GitHub上的OSX为我的Git GUI。

但是,当我做编辑的文件在我的本地Git仓库我的硬盘上,然后使用GitHub上的OSX尝试“提交和同步,”我得到这个错误:

git: 'credential-osxkeychain' is not a git command. See 'git --help'.
git: 'credential-osxkeychain' is not a git command. See 'git --help'.
2013-02-12 02:49:07.409 GitHub for Mac Login[44516:707] AskPass with arguments: (
    "/Applications/GitHub.app/Contents/MacOS/GitHub for Mac Login",
    "Password for 'https://username@bitbucket.org': "
)
git: 'credential-osxkeychain' is not a git command. See 'git --help'.
git: 'credential-osxkeychain' is not a git command. See 'git --help'.
To https://username@bitbucket.org/username/data.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://username@bitbucket.org/username/data.git'
hint: Updates were rejected because the tip of your current branch is behind its remote counterpart. Merge the remote changes (e.g. 'git pull') before pushing again. See the 'Note about fast-forwards' in 'git push --help' for details.
 (256)

(我编辑了以上隐瞒我的实际用户名。)

这是什么意思,我怎么解决它,如何避免得到它的未来?

Answer 1:

有人(或你)已经更新远程分支。 这会导致你的远程分支成为领先你的当前分支。 (这是你的本地分支)

我建议你git pull --rebase origin masterpush后。



文章来源: How do I resolve a GitHub message that says the tip of my current branch is behind its remote counterpart?