Difference between revisions of "Git Notes"

From PeformIQ Upgrade
Jump to navigation Jump to search
Line 1: Line 1:
Also see - [[Git_SCM_Notes]]


=Branching=
=Branching=


* gitbranch \--set-upstream xxx origin/xxx
* gitbranch --set-upstream xxx origin/xxx
* git branch \-a
* git branch -a
* git push origin xxx
* git push origin xxx
* git push origin xxx:yyy
* git push origin xxx:yyy
Line 20: Line 21:
=Remotes=
=Remotes=


* git reote \-v
* git remote -v
* git remote another [https://xxxx@xxxx.com/xxx/xxx.git]
* git remote another [https://xxxx@xxxx.com/xxx/xxx.git]
* git remote add tim git://xxxxx@xxxx.com/xxx/repo.git
* git remote add tim git://xxxxx@xxxx.com/xxx/repo.git
Line 33: Line 34:
=Reviewing=
=Reviewing=


* git log \--graph \--pretty=oneline
* git log --graph --pretty=oneline


* git log -- ../bin/chk_lrs.py
* git log -- ../bin/chk_lrs.py
* git diff xxx origin/xxx \--word-diff
* git diff xxx origin/xxx --word-diff
* git diff master^\^ origin/master \--word-diff
* git diff master^\^ origin/master --word-diff


=After a Conflict=
=After a Conflict=


* git diff
* git diff
* git checkout \--ours -- the_file
* git checkout --ours -- the_file
* git checkout \--theirs -- the_file
* git checkout --theirs -- the_file


=Other=
=Other=


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




Note, this will discard local changes\!
Note, this will discard local changes!
 
 
Also see - [[Git_SCM_Notes]]




[[Category:Git]]
[[Category:Git]]
[[Category:SCM]]
[[Category:SCM]]

Revision as of 01:53, 13 June 2014

Also see - Git_SCM_Notes

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!


Also see - Git_SCM_Notes