Git archive all changes except first commit

眉间皱痕 提交于 2019-12-11 14:28:44

问题


I have a third party product I need to make changes to. I've committed all of the stock code as my first commit. Now I've committed several times and made many changes.

How can I export an archive of just the changes? I want all adds/changes since the first commit but nothing in the first commit if it hasn't been modified. There will have been no deletes to files that occurred in the first commit.


回答1:


I would suggest the patch format, with a git format-patch

git format-patch --stdout firstCommitSHA1.. > aPatch

With firstCommitSHA1 being your first commit: it will select everything after that first commit up to your current HEAD, and generate patches easily applied to another repo through git am.



来源:https://stackoverflow.com/questions/8347131/git-archive-all-changes-except-first-commit

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