我的經理希望我推送我所做的新更改,以便他可以從拉取請求中查看并合并到 master 中。然而,當我編碼時,還有一些其他技術人員致力于掌握。經理告訴我必須只有 1 次提交,以便在推送歷史記錄中他不會看到“將 master 合并到分支”之類的內容。我在幾個分支上作業,每個分支都有不同的名稱。我怎樣才能做到這一點?
我嘗試將 master 和 merge master 拉入我的分支,并在嘗試再次推送到 master 之后,但在這種情況下,我們看到諸如“將 master 合并到分支”之類的提交訊息和實際提交訊息。
如果重復,請提供網址。謝謝!
Manager wants to see something like:
- commit by: me (without merge message)
- commit by: another guy
- commit by: another guy
uj5u.com熱心網友回復:
所以解決方案似乎使用rebase
在提交之前,您可以使用:
git checkout master
git pull
git checkout your-branch
git rebase master
git commit
git push origin your-branch
您可以稍后創建拉取請求。
如果您已經創建了拉取請求并希望您的歷史記錄與 master 保持同步:
git checkout master
git pull
git checkout your-branch
git rebase master
git push origin your-branch --force
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/335830.html
