Difference between revisions of "Git Notes"

From PeformIQ Upgrade
Jump to navigation Jump to search
(Created page with " h1. Branching * gitbranch \--set-upstream xxx origin/xxx * git branch \-a * git push origin xxx * git push origin xxx:yyy * git checkout remote/origin/zzz h2. Low Level Stu...")
 
Line 1: Line 1:


h1. Branching
=Branching=


* gitbranch \--set-upstream xxx origin/xxx
* gitbranch \--set-upstream xxx origin/xxx
Line 8: Line 8:
* git checkout remote/origin/zzz
* git checkout remote/origin/zzz


h2. Low Level Stuff
==Low Level Stuff==


$ cd .git/reps/heads
$ cd .git/reps/heads
Line 18: Line 18:
* git branch yesterday e79ff9e5926bd
* git branch yesterday e79ff9e5926bd


h1. Remotes
=Remotes=


* git reote \-v
* git reote \-v
Line 27: Line 27:
* git diff xxx origin/xxx
* git diff xxx origin/xxx


h1. Broadcasting a Local Repo
=Broadcasting a Local Repo=


* git serve
* git serve


h1. Reviewing
=Reviewing=


* git log \--graph \--pretty=oneline
* git log \--graph \--pretty=oneline
Line 39: Line 39:
* git diff master^\^ origin/master \--word-diff
* git diff master^\^ origin/master \--word-diff


h1. After a Conflict
=After a Conflict=


* git diff
* git diff
Line 45: Line 45:
* git checkout \--theirs -- the_file
* git checkout \--theirs -- the_file


h1. Other
=Other=


* git pull origin \+master:master
* git pull origin \+master:master
* git reset -- HEAD
* find dir -type f | xargs git reset


Note, this will discard local changes\!
Note, this will discard local changes\!

Revision as of 18:36, 7 May 2014

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

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\!