2013-02-08 67 views
0

我做了git fetch origin master然後git pull origin master這兩個命令後,當我做了git status我得到:git的取指,然後git的拉讓我提前起源碩士/

$ git status 
# On branch master 
# Your branch is ahead of 'origin/master' by 5 commits. 
# 
nothing to commit, working directory clean 

發現這種奇怪的(因爲我現在我的地方是落後origin/master)我再次克隆庫到其他位置,並得到了它正確,所以遠程回購協議確定。首先執行git fetch命令,我使用聯機存儲庫更新了本地原產地/主機的權限?比git pull本來是要再次讀取,然後合併,但我想它也沒有,不知道爲什麼。任何人都可以解釋嗎?

謝謝!

[編輯]
我更糊塗了。現在我在我的原始機器上工作,只是做了git pull origin master。令我驚訝的是,同樣的事情再次發生。我使用了git reflog --all建議,並且我在另一臺機器上做的一個提交沒有顯示。此提交看起來好像我在此計算機上提交的(因此再次顯示ahead of ...消息)。按照發生的情況,從終端窗口複製/粘貼(僅省略一些個人信息)。

[email protected]:~/my_project$ git pull origin master 
remote: Counting objects: 5, done. 
remote: Compressing objects: 100% (3/3), done. 
remote: Total 3 (delta 2), reused 0 (delta 0) 
Unpacking objects: 100% (3/3), done. 
From my_git_site:my_repo 
* branch   master  -> FETCH_HEAD 
Updating some_bizarre_number 
Fast-forward 
main.py | 18 ++++++++++-------- 
1 file changed, 10 insertions(+), 8 deletions(-) 
[email protected]:~/my_project$ git status 
# On branch master 
# Your branch is ahead of 'origin/master' by 1 commit. 
# 
nothing to commit (working directory clean) 

回答

2

該消息意味着在你的本地主5名提交,你有沒有推到原點/主。拉將有來自產地/掌握新提交合並的提交和致力於本地的結果,顯然沒有衝突或會要求你解決這些問題。

如果你看看當地的修訂歷史記錄,你會看到你的提交和遠程提交和新的承諾,它們一起將它們合併,是當前的HEAD。

+0

「該消息意味着在你的本地主5名提交,你有沒有推到原點/主。」好。問題是我知道我的本地主人在我的出身/主人背後。這是令我困擾的事情。 – marcelocra 2013-02-08 15:57:39

0

嘗試引用日誌的git --all,看看有什麼是你的最後5次提交。也許這會澄清那些提交來自哪裏。

+0

我編輯了我的答案。感謝您的迴應! – marcelocra 2013-02-08 21:43:41