14 January 2016

how to

  1. create a patch

    1. clone and create a new branch

       $ git clone url_to_some_repo
       $ cd repo
       $ git checkout -b fix_sth
      
    2. hack whatever you want

    3. list you commits

       $ git log --pretty=oneline -3
      
    4. create a patch against master

       $ git format-patch master --stdout > fix_sth.patch
      
  2. apply a patch

    1. what changes are in the patch

       $ git apply --stat fix_sth.patch
      
    2. test patch before actually apply it

       $ git apply --check fix_sth.patch
      
    3. am allows you to sign off an applied patch

       $ git am --signoff < fix_sth.patch
      


blog comments powered by Disqus