Github分支领先消息不明确 [英] Github Branch is ahead message not clear

查看:152
本文介绍了Github分支领先消息不明确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

GIT中:你的分支是超前用X提交



GIT中分支是在产地/大师之前



我已阅读上述两个问题,但仍无法回答我的问题。基本上我所做的是


  1. 在GitHub中创建一个新的存储库。

  2. 克隆并获取我本地linux框中的数据
  3. 使更改执行git add,然后执行git commit -m消息

  4. 最后做一个git push https://github.com /username/sandbox.git 。这工作正常,我使用的是https协议,而不是SSH协议(请注意,如果我只是git push它使用SSH协议,我还没有配置然后失败)

  5. 执行git pull https:// github.com/username/sandbox.git 也是 混帐获取 https://开头的github .com / username / sandbox.git ,所有这些都成功地表示已经是最新的。

  6. 访问github网站,我可以看到更改。 / li>
  7. 现在运行git status,我现在看到以下内容:


    关于分支主数据库
    您的分支在9次提交之前位于'origin / master'之前。



这不是我所期望的。有人可以告诉我为什么Git认为我在9次提交中领先于原点/主人。我已经推送和拉取数据,所以我期望我的本地回购与远程主/回购完美同步。



命令git branch -av显示如下

  * master a99daf0 [提前9]提交
remotes / origin / HEAD - >起源/主
的遥控器/来源/主81c7ec1移除出文件


解决方案

作为一个新手我实际上需要的是通过米姆斯ħ莱特在我怎样才能找到原产地/主在git中的位置,我该如何改变它?最终点到链接 http://fvue.nl/wiki/Git%3a_Your_branch_is_ahead_of_the_tracked_remote_branch



基本上我不得不这样做

pre $ g $ git push origin master master


git: Your branch is Ahead by X commits

Git branch is ahead of origin/master

I have read both questions above and it still does not answer my questions. Basically what I did was

  1. Create a new repository in GitHub.
  2. Clone and get the data in my local linux box
  3. Make changes do "git add" then do a "git commit -m "message"
  4. Finally do a "git push https://github.com/username/sandbox.git". This works fine and I use the https protocol that is advised instead of the SSH protocol (Please note if I do just "git push" it uses the SSH protocol which I have not configured yet and it fails)
  5. Perform "git pull https://github.com/username/sandbox.git" and also "git fetch https://github.com/username/sandbox.git" all of which performed successfully saying "Already up-to date".
  6. Visit the github website and I can see the changes.
  7. Now run "git status" and I now see the following

    On branch master
    Your branch is ahead of 'origin/master' by 9 commits.

This was not what I expected. Can someone tell me why git thinks I am ahead of the origin/master by 9 commits. I have pushed and pulled the data so I would expect my local repo to be in perfect sync with the remote master/origin repo.

The command "git branch -av" shows the following

 * master                a99daf0 [ahead 9] submit
  remotes/origin/HEAD   -> origin/master
  remotes/origin/master 81c7ec1 remove out files

解决方案

As a newbie what I actually needed was the answer described by "Mims H Wright" at How can I find the location of origin/master in git, and how do I change it? which eventually points to the link http://fvue.nl/wiki/Git%3a_Your_branch_is_ahead_of_the_tracked_remote_branch.

Basically I had to do

git push origin master:master

这篇关于Github分支领先消息不明确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆