git format-patch < everything>

前端 未结 2 2002
时光说笑
时光说笑 2021-01-22 16:24

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

相关标签:
2条回答
  • 2021-01-22 16:35

    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.)

    0 讨论(0)
  • 2021-01-22 16:46

    For dealing with one file, git diff is more appropriate (for patches of text files)

    git diff R1..R2 > patchR1R2.diff
    
    0 讨论(0)
提交回复
热议问题