使用 Git 的一些技巧
2. 善用 squash commit,squash 完心情都很好
3. commit 之前一定要先 format code 一次,不然多出來的 reformat commit 會很難整理
4. 拆 commit,盡可能讓每個 commit 都可以 build & test,也比較好回到上游
5. 如果 local 修改的整理過的 commit tree 要 rebase 上去就只能用 rebase onto
e.g.,
git fetch upstream
git checkout -B local-rebase-branch upstream/feature/binance-futures
git rebase -i upstream/main
.... 改改改
git push -f origin HEAD
-B 會洗掉原本就有的 local branch
留言
張貼留言