【发布时间】:2015-11-18 00:39:52
【问题描述】:
我对使用 Git 还很陌生,但我确实了解基本的基础知识。但是,我还没有遇到过推/拉冲突的情况……直到现在。
另外,我应该指出,我用来与 Git 存储库交互的 GUI 工具是 Atlassian SourceTree(我们使用 Atlassian Stash 来管理我们的存储库)。
这是场景:
我有 2 次提交到 Push,显然我需要对 Pull 进行 4 处更改。
当我尝试Pull 时,我得到了这个:
git -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin
git -c diff.mnemonicprefix=false -c core.quotepath=false pull --no-commit origin master
You have not concluded your merge (MERGE_HEAD exists).
Please, commit your changes before you can merge.
Completed with errors, see above.
它说我需要完成我的合并,但它不允许我做任何事情。我没有得到合并列表,也没有自动合并。我似乎无法通过合并,因此我可以继续解决 Push/Pull 冲突。
当我尝试Push 时,我得到了这个:
git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags origin master:master
Pushing to http://XXXXXX@XXXXXXXX.XXXX.XXXX:XXXX/XXXX/XXXX/XXXXX.git
To http://XXXXXX@XXXXXXXX.XXXX.XXXX:XXXX/XXXX/XXXX/XXXXX.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'http://XXXXXX@XXXXXXXX.XXXX.XXXX:XXXX/XXXX/XXXX/XXXXX.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
现在我该怎么解决这个问题?!我将不得不Rebase 或类似的东西吗?
我正在阅读有关 Fast Forward Push 的信息,但我不知道如何在此工具中执行此操作。如果必须,我当然可以从终端执行 Git 命令。我只是不想在没有咨询对 Git 和这些类型的问题有更好理解的人的情况下跳进去。
【问题讨论】:
-
我刚刚意识到我可能听起来很愚蠢,问我的问题并发布
Pull输出说“You have not concluded your merge (MERGE_HEAD exists). Please, commit your changes before you can merge.”,而没有提到它不允许我合并任何东西的事实。这可能导致对我的帖子投反对票。我已编辑我的帖子以提及该问题。
标签: git atlassian-sourcetree bitbucket-server