I'm trying to mash all my changes since I last pushed to the svn server into one big patch that I can email to my coworker for review. Can I do this with git format-patch
?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You could use git format-patch origin/master
to get all the patches since your current branch forked from the server. (The HEAD is assumed as the final argument in the command, so you are getting origin/master..HEAD
.)
However, as VonC hints at, that could potentially create a lot of files: one .patch file for every commit you made! If you want just a single big patch file, the git-diff
syntax he mentions should to the trick. (git diff origin/master.. > bigpatch.patch
would give you all the changes since the common ancestor of your HEAD and the server.)
回答2:
For dealing with one file, git diff
is more appropriate (for patches of text files)
git diff R1..R2 > patchR1R2.diff