2022年7月7日星期四

git commit comment 整理

======git  history: ======

commit: comment1 

commit: comment2 

commit: comment3 

commit: comment4 

commit: comment5 

commit: comment6 

commit: comment7 

commit: comment8 

commit: comment9 

commit: comment10 

commit: comment11 

======git  history: ======

目標: 

comment1 ~comment5:  commit => project1

comment6 ~comment10: commit => project2

方法:

git rebase -i HEAD~10

--edit commit: comment1 

--edit commit: comment2 

--edit commit: comment3 

--edit commit: comment4 

--edit commit: comment5 

--edit commit: comment6 

--edit commit: comment7 

--edit commit: comment8 

--edit commit: comment9 

--edit commit: comment10 

git commit --amend 

commit: comment1  -> project1: comment1  

git rebase --continue 

git commit --amend 

commit: comment2 -> project1: comment2 

git rebase --continue 

git commit --amend 

... 

git rebase --continue 

git commit --amend 

commit: comment10 -> project2: comment10

Successfully rebased and updated refs/heads/$branchname


=================

pick -そのまま保留

edit -コメント編集へ

squash - 前のcommitにマージする,コメント変更可

fixup - 前のcommitにマージする,コメントも前のコメントに従う

drop -該当commitを削除





没有评论: