Skip to content

How to submit patch

Yinhang Liu edited this page Mar 7, 2019 · 6 revisions
  1. Watch libxcam project
    go to libxcam, and hit 'watch'.
    Then you can receive any others commit/comments
  2. Fork libxcam to your own account, hit 'fork'
  3. Get libxcam code to local.
    $ git clone git@github.com:user/libxcam.git
  4. Add 'upstream' for rebase
    $ git remote add upstream https://github.com/intel/libxcam.git
    $ git fetch upstream
  5. Edit patch.
  6. Format patch before commit.
    $ ./code_style.sh
    $ git commit -m "xxxx"
  7. Rebase with upstream
    $ git fetch upstream
    $ git rebase upstream/master
    If failed, fix conflicts first.
  8. Push commit to your account.
    $ git push origin
  9. Go to github home, create 'pull request'
  10. Wait for review, If accepted, maintainer would merge to upstream; else, continue edit patch

How to sync up local repo with upstream

  • Every time, before edit source code, run
    $ git fetch upstream
    $ git rebase upstream

  • If there's conflicts but you are sure can be fixed. try to edit conflict files, then
    $ git add xxxx # xxxx means conflict files
    $ git rebase --continue

  • If maintainer fixed your patch. Try
    $ git fetch upstream
    $ git format-patch -2 #backup your local patches, 2 means there are 2 local patches to backup
    $ git reset --hard upstream/master # be careful of --hard, this may reset all your local patches. that's why need to backup at first
    $ git am 000*.patch # to restore you local patches, if there's conflicts, try to fix.