0%

Git只合并某几次提交

伟大的心胸,应该表现出这样的气概——用笑脸来迎接悲惨的厄运,用百倍的勇气来应付一切的不幸。 —— 鲁迅

  1. cd ~
  2. git init git_cherry
  3. cd git_cherry
  4. vim master.txt
1
This is master file
  1. git add .
  2. git commit -m ‘master first commit’
  3. git checkout -b develop
  4. vim master.txt,增加以下内容
1
This edtion is in develop branch
  1. git add .
  2. git commit -m ‘in develop branch edit master.txt’
  3. vim develop.txt
1
This is develop file
  1. git add .
  2. git commit -m ‘init develop.txt and commit’
  3. git log,拿到需要合并的提交id
  4. git checkout master
  5. git cherry-pick commit_id
  6. git log