Skip to content

Latest commit

 

History

History
25 lines (16 loc) · 629 Bytes

patch.md

File metadata and controls

25 lines (16 loc) · 629 Bytes

Patch Back

Patches formatted under Git has provided us with a way to apply commits from one repository to another, even if their structures are different.

The usage is quite simple:

  1. To generate patch files first:

    git format-patch -1 <commit_sha>

    If you want to create patches of several commits, you may need to change the parameter:

    git format-patch -n <commit_sha> 

    Then, Git will generate some *.patch files under the current workspace

  2. Apply generated patches:

    git apply *.patch --directory='<relative_path>'