3 回答

TA貢獻1936條經(jīng)驗 獲得超7個贊
用軟復位代替重基對壁球歷史的影響
git rebase
你有一支樹枝 ticket-201
你的分支 master
..你想假裝所有的提交 ticket-201
從來沒有發(fā)生過,但你一舉完成了所有的工作。 軟重置到分支點,使用 git reset --soft hash
哪里 hash
中的提交散列。 ticket-201
原木。 使用Add提交更改,然后提交?,F(xiàn)在,分支歷史將只有第一次提交和新的提交與新的內(nèi)容。
在不同的分支中根據(jù)任意提交創(chuàng)建歷史
檢查一個新的分支機構(gòu) commit0
(假裝這是一個哈希): git checkout -b new-history commit0
現(xiàn)在你可以從 commit5
:git reset --hard commit5
切換回索引點: git reset --soft commit0
提交,這將是分支中的第二次提交。

TA貢獻1777條經(jīng)驗 獲得超3個贊
用南瓜代替
squash
git merge temp --squash
Ticket65252
:
git branch -d temp #remove old temp bbranch git checkout -b temp # work work work, committing all the way git checkout Ticket65252 git merge temp --squash git commit -m "Some message here"
rebase
reset --hard
reset --soft
?
- 3 回答
- 0 關(guān)注
- 505 瀏覽
添加回答
舉報