Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git修改提交记录说明 #44

Open
Bobjoy opened this issue Jan 8, 2021 · 0 comments
Open

git修改提交记录说明 #44

Bobjoy opened this issue Jan 8, 2021 · 0 comments

Comments

@Bobjoy
Copy link
Owner

Bobjoy commented Jan 8, 2021

修改提交说明

  1. git log # 找到要修改了提交记录 B
  2. git rebase -i B
    pick A change A
    pick B change B
    pick C change C
    
    改为
    pick A change A
    edit B change B
    pick C change C
    
  3. git add . && git commit --amend
    change B
    
    改为
    change BBBBBB
    
  4. 修改提交记录说明并保存退出

修改提交顺序

pick A change A
pick B change B
pick C change C

改为

pick B change B
pick A change A
pick C change C

合并提交

pick A change A
pick B change B
pick C change C

改为

pick A change A
squash B change B
squash C change C

拆分提交

pick A change A
pick B change B
pick C change C

改为

pick A change A
edit B change B
pick C change C

然后执行一下命令

  • git reset HEAD^
  • git add test/*
  • git ci -m 'add test'
  • git add code/*
  • git ci -m 'update code'
  • git rebase --continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant