本篇重點
- 如果有尚未提交的變更,無法使用
git rebase
git rebase
合併不會產生額外的合併提交,但是會變更原本的提交 IDgit rebase -i
(互動式 rebase)編輯功能- 使用
git rebase -i
調整提交順序、修改提交訊息、修改提交內容、合併提交、刪除提交 git rebase
的注意事項
git rebase
git rebase
合併不會產生額外的合併提交,但是會變更原本的提交 IDgit rebase -i
(互動式 rebase)編輯功能git rebase -i
調整提交順序、修改提交訊息、修改提交內容、合併提交、刪除提交git rebase
的注意事項【Tool】Unix 時間戳(Unix timestamp) 轉換
Date()
應用【Git】使用 git commit 修改提交(commit)的資訊或是內容
git commit --amend
修改最新一次提交的資訊或是內容git commit --amend --author
修改提交的作者和信箱git commit --amend --reset-author
重置提交的作者和信箱git commit --amend -m
修改提交訊息git commit --amend --no-editor
提交修改但不修改提交訊息git commit --amend
都會變更提交 ID【NPM、GitHub】解決 npm 版本落後 GitHub 版本的問題