Git无法推动掌握

时间:2016-04-18 05:43:29

标签: git github

我一直致力于我的项目并创建了一个分支(newBranch)。现在newBranch提前13次提交,1次提交远程master(因为我在github上编辑了readME)。

我在这里阅读了一堆问题,不知怎的,我认为我的情况变得更糟。 现在,当我推动掌握时,我得到了

 = [up to date]      master -> master
updating local tracking ref 'refs/remotes/origin/master'
Everything up-to-date

但是当我继续使用我的github时,它说newBranch比主人提前14。到底发生了什么?我如何修复它,我只想让master分支与我的newBranch相同

2 个答案:

答案 0 :(得分:1)

  

我只想让master分支与我的newBranch相同。

转到Github.com,切换到newBranch,New Pull Request,然后合并您的分支。

答案 1 :(得分:1)

您可以将newBranch合并到master,也可以尝试在master上重新定位newBranch。由于您是初学者,您可能会发现合并选项对您来说最简单:

git checkout master   # switch to the master branch
git merge newBranch   # merge newBranch into master

然后你可以将更新的master推送到GitHub:

git push origin master

请注意,您可能需要手动解决合并冲突(查找<<<===等标记。)

相关问题