How do patches work in Git?

后端 未结 6 1346
遥遥无期
遥遥无期 2020-12-23 12:02

I\'m new to Git, but familiar with SVN. As a test I made a repository in a local directory with git init. Then I cloned the empty repository (over SSH using 127

6条回答
  •  悲哀的现实
    2020-12-23 12:41

    Create your patch via:

    $ git format-patch master --stdout > patch.diff
    

    then patch.diff will contain the diff, which you can then send to someone else to apply using:

    $ git am < patch.diff
    

    Sometimes, when the manuals are a little dense, it makes sense to look for a tutorial:

    http://luhman.org/blog/2009/09/22/git-patch-tutorial

提交回复
热议问题