spitfire-sidra / myapollo-issues

#utterances
0 stars 0 forks source link

blog/git-tutorial-rebase/ #9

Open utterances-bot opened 7 months ago

utterances-bot commented 7 months ago

Git 版本控制教學 - 用範例學 rebase - MyApollo

常言道「不會 rebase, 等於沒學過 Git」,由此可見 rebase在 Git 內有多重要。 在開始本文之前,請大家牢記千萬不要對已經 push 到遠端儲存庫(remote repository) 而且已經有人正在使用的提交進行 rebase ,這是很危險的!詳情請見 The Perils of Rebasing 。 Do not rebase commits that exist outside your repository and that people

https://myapollo.com.tw/blog/git-tutorial-rebase/

jia880171 commented 7 months ago

所以版主會在確定已經用rebase整理完所有commit後,才push到遠端囉?如果已經push出去之後是不是就只能開新分支整理,再merge進來?

spitfire-sidra commented 7 months ago

@jia880171 是的, push 到遠端之前先用 rebase 整理好。如果已經 push 出去之後再整理的話,很容易會影響到其他在同分支工作的開發者,因為 rebase 會產生新的 commit id, 等於是修改歷史,會造成別人的歷史跟你的歷史不一致,這時候很可能會產生許多 conflicts 要逐一確認