How can I skip commits in git?

僤鯓⒐⒋嵵緔 提交于 2019-12-05 00:16:31

I can give you two options:

  • Interactive rebase (git rebase -i) presents you a list of commits, editing this list will change the result of the operation; lets you reorder, delete or tag these commits for miscellaneous operations. In your case, you can rebase [*]'s branch into [_]'s and delete the lines unwanted commits.

  • Cherrypick lets you apply the changes of a single commit into another branch. In your case, you can simply cherrypick commit [*] into [_]'s branch.

You could check out your _ and cherry pick the *. If you want that on a separate branch, you can branch off from _ before doing this.

You can combine your commits by rebase and squashing the ones you dont need. May be you did not do squash and pick.

Refere this: http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!