Git Notes

Bring Local Branch Upstream

We have a local branch, the-branch that we want to push to our upstream repo.

$ git push -u git@github.com:jfasch/jfasch-home.git the-branch

Create Remote Tracking Branch

$ git clone git@github.com:jfasch/jfasch-home.git
$ git checkout --track origin/the-branch

Miscellaneous

  • repo am server, initial push

  • Remote in lokalen Branch

    git remote add <my-remote-name> <repo> git fetch <myremote-name> git checkout -b <my-branch> <my-remote-name>/<remote-branch>

  • Patches per Email

    git format-patch -o dir branch-von-wo git format-patch -o dir –root # since beginning of project git send-email –compose dir

    Single commit: -1

  • remote branches

    git remote add orig-work ~/work/non-vc/STIA.git git remote -v git fetch orig-work

    Create tracking branch:

    git checkout -b my-rpi-3.12.y remotes/raspberry/rpi-3.12.y