Github Notes

Bipul Kuri
May 9, 2020

Usecase 1

when you want to push your single commit changes from your repo to upstream

$ git fetch --all
$ git checkout -b my-single-commit-change upstream/master
$ git cherry-pick bf77ad7da
$ git push -u origin my-single-commit-change

where

upstream — → github.com/project

origin — →github/user/project this is where my awesome single commit is

you want to move code from origin 1 commit (my single change) to upstream repo for a PR

Usecase 2

To sync upstream branch with origin branch

git checkout --track origin/branch
git merge upstream/branch
git push origin branch

where

upstream — → github.com/project

origin — →github/user/project

--

--