2017-03-06 82 views
0

我已經看到了這一點: -你的分支是領先了3起源大師的承諾

why does it say "Your branch is ahead of origin/master by 857 commits" when I need to *pull* origin master Git - "Your branch is ahead of 'origin/master' by 3 commits." Your branch is ahead of 'origin/master' by 3 commits 'Your branch is ahead of 'origin/master' by 1 commit' on explicit push

我是新來的git

但AFAICT它並沒有解決我的問題... 事情是我經常得到這個問題,但它喜歡它自己解決了很多次,在一段時間後,它是這樣的: -

$ git status 
On branch master 
Your branch is ahead of 'github/master' by 3 commits. 
(use "git push" to publish your local commits) 

nothing to commit, working directory clean 

所以我檢查了github回購所有改變已經被推...就像我也再次推動起源/主,仍然git狀態顯示這一點。

我還從產地/主拉...它得到了在拉動全成......但之後,它仍然顯示做git的狀態後,同一

請告訴我一個很好的解決它,也是原因如果可能的話爲什麼會這樣......除了原因「您當地的回購協議具有不能被推到遠程提交」 預先感謝您

+0

編號沒有任何事情發生。必須有一些東西 – Smit

+1

根據我們上次從原始數據獲取數據後知道的情況,您的分支處於領先地位。做'git fetch',你會看到不同的信息。 – aragaer

+0

@Smit我知道承諾是本地和推動起源是遙遠的.... –

回答

3

你的分支是超前「的github /主」的通過3提交。

注:當地分行是超前github上/主沒有產地/主的。

因此,您需要將您的更改推送到github/master。假設您有寫入權限github/mastergithub repo master分支)。

$ git remote -v   # you can see the url of 'github' repo  

$ git push github master 

現在您的本地和github/master應該同步。

$ git status 
+0

在這個解決方案中,我們從遠程拉再推回來,所以是的,這可能會做,但我不認爲這是它的正確解決方案 無論如何謝謝你的努力 –

+0

在這裏,你可以跳過拉,只要做推。對你起作用嗎?更新了答案。 –

+0

nope這是我第一次嘗試作爲事實... –