gpt4 book ai didi

git - 我如何解决一条 GitHub 消息,指出我当前分支的尖端落后于它的远程分支?

转载 作者:IT王子 更新时间:2023-10-29 00:58:03 24 4
gpt4 key购买 nike

我正在努力学习如何使用 GitHub 对我的工作进行版本控制。 (我一个人工作,没有合作者,没有不同的分支机构,只有我在工作时备份我的工作。)我在 BitBucket.org 上建立了私有(private) Git 存储库。我使用 GitHub for OSX 作为我的 Git GUI。

但是,当我对硬盘驱动器上本地 Git 存储库中的文件进行编辑,然后使用 GitHub for 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)

(我编辑了上面的内容以 stash 我的实际用户名。)

这是什么意思,我该如何解决它,以及如何避免以后再遇到它?

最佳答案

有人(或你)更新了远程分支。这会导致您的远程分支领先于您当前的分支。 (那是你本地的分行)

我建议你 git pull --rebase origin master 然后 push

关于git - 我如何解决一条 GitHub 消息,指出我当前分支的尖端落后于它的远程分支?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14827930/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com