The Wayback Machine - http://web.archive.org/web/20200604030315/https://github.com/topics/notes?l=html
Skip to content
#

notes

Here are 227 public repositories matching this topic...

wujunchuan
wujunchuan commented Mar 27, 2017

使用场景

你正在做一个项目,然而在过去的某个时候,你把两个重大的改动提交到了一个版本A中。 直到又进行了几次提交之后,你才发现有必要将之前那两个重大改动拆分成版本A和版本B。

使用步骤

  1. git rebase -i HASH 返回到你需要拆分的版本
  2. git reset HEAD~返回到你需要拆分的上一个版本(此时的代码保持的版本A与版本B的共同内容)
  3. 删除版本记录git rm file --cache
  4. 拆分文件,提交版本A的代码 gti commit --amend -m ‘Version A’
  5. 将版本B的代码加入,提交版本B的代码 git commit -m ‘Version B
  6. 结束交互式rebase git rebase - -contine
  7. 然后你就会发现,需要拆分的版本已
Git

Improve this page

Add a description, image, and links to the notes topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the notes topic, visit your repo's landing page and select "manage topics."

Learn more

You can’t perform that action at this time.