【问题标题】:Git merge and git pull to local branch are not working [duplicate]Git合并和git pull到本地分支不起作用[重复]
【发布时间】:2018-09-16 20:17:18
【问题描述】:

我刚刚在本地分支上运行了 git merge master,解决了它所呈现的冲突。

但是,git 现在不再允许我使用 git push 提交到我的分支。我刚刚运行了 git pull 并收到了这样的反馈:

    There is no tracking information for the current branch.
    Please specify which branch you want to merge with.
    See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=<remote>/<branch> 4318-niall-activities

我不想修改我当前的工作,但我想提交一个包含我所有当前工作的拉取请求。任何人都可以提供一些建议吗?

【问题讨论】:

  • 4318-niall-activities 是否存在于远程存储库中,您之前是否将此分支推送到它?
  • @castis 是的,我一直在用它一整天,但是由于我已经将master合并到分支中,它不允许我推送到git
  • 你对错误信息有什么不明白的地方?
  • @jhpratt 将 git pull 4318-niall-activities 覆盖我在本地分支机构的工作?

标签: git


【解决方案1】:

正如错误消息所指出的,您的本地分支未链接到远程存储库。您可以使用git push origin [remotebranch] 或使用git branch --set-upstream-to=&lt;remote&gt;/&lt;branch&gt; 4318-niall-activities 来再次推送或拉取,用您的用例替换远程和分支。远程通常是origin

【讨论】:

  • git push origin 4318-niall-activities 回馈:error: failed to push some refs to 'https://github.com/comediadesign/nec-phase-1.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.
  • 然后执行 git pull origin 4318-niall-activities ,它会将远程更改合并到您的本地工作中。不会删除您的工作
猜你喜欢
  • 2014-08-28
  • 1970-01-01
  • 1970-01-01
  • 2013-03-05
  • 2014-09-23
  • 2011-03-04
  • 2023-03-06
  • 2014-03-06
  • 2019-10-27
相关资源
最近更新 更多