Git Notes
Revision as of 18:36, 7 May 2014 by PeterHarding (talk | contribs)
Branching
- gitbranch \--set-upstream xxx origin/xxx
- git branch \-a
- git push origin xxx
- git push origin xxx:yyy
- git checkout remote/origin/zzz
Low Level Stuff
$ cd .git/reps/heads $ ls $ cat xxx $ cd ../objects/db $ ls
- git checkout e79ff9e ==> Detached HEAD
- git branch yesterday e79ff9e5926bd
Remotes
- git reote \-v
- git remote another [1]
- git remote add tim git://xxxxx@xxxx.com/xxx/repo.git
- git fetch originhttps
- git fetch
- git diff xxx origin/xxx
Broadcasting a Local Repo
- git serve
Reviewing
- git log \--graph \--pretty=oneline
- git log -- ../bin/chk_lrs.py
- git diff xxx origin/xxx \--word-diff
- git diff master^\^ origin/master \--word-diff
After a Conflict
- git diff
- git checkout \--ours -- the_file
- git checkout \--theirs -- the_file
Other
- git pull origin \+master:master
- git reset -- HEAD
- find dir -type f | xargs git reset
Note, this will discard local changes\!