3 回答

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

TA貢獻(xiàn)1831條經(jīng)驗(yàn) 獲得超9個(gè)贊
用南瓜代替
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)注
- 1207 瀏覽
添加回答
舉報(bào)