2011-02-14 84 views
3
git clone blah 
git checkout -b development 
git checkout -b bug581 
hack hack 
git checkout -b bug588 
hack hack 

哦,等等,錯誤588應該從發展萌芽,而不是581的Git,重訂不正確的分支的分支

git rebase --onto development bug581 bug588 

給我:

Cannot rebase: You have unstaged changes. 
Please commit or stash them. 

錯了,但我不? git status顯示工作目錄是乾淨的。所以讓我們藏起來咯咯地笑。

git stash 
git rebase --onto development bug581 bug588 

確定現在它的工作原理,但其拉蟲581和588的歷史,我只想要588的歷史上,沒有什麼是581

+1

見http://stackoverflow.com/questions/4673952/fixing-published-branch-與錯誤的父母分支 – NamshubWriter 2011-02-14 07:14:56

回答

5

我在一個mac上,這個晦澀的配置更改似乎解決了所有我的問題,當沒有任何暫時的更改時。

git config --global core.trustctime false 

我認爲這是與Windows文件時間,Linux文件時間和Mac文件時間之間的差異。誰知道,如果你願意,可以隨時發表評論。

0

第二次你「砍砍」 ,是你未分離的變化發生的地方。

+0

以及我認爲這是相當明顯的,從我的語言,任何更改提交,所以工作目錄將是乾淨的。 – jhogendorn 2011-02-14 04:56:46

+0

@devians:你永遠不會提到一個提交。我們是程序員,確切地說。 – Arafangion 2011-02-14 05:15:30

2

你有汽車重新啓動嗎?

看看你的〜/的.gitconfig或git的/配置爲

[branch "master"] 
    rebase = true

[branch] 
    autosetuprebase = always