Difference between revisions of "Git Notes"
Jump to navigation
Jump to search
PeterHarding (talk | contribs) (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...") |
PeterHarding (talk | contribs) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Also see - [[Git_SCM_Notes]] | [[Summary_of_Git_Commands]] | [[Getting Started with Git]] | |||
=Branching= | |||
* gitbranch | * gitbranch --set-upstream xxx origin/xxx | ||
* git branch | * git branch -a | ||
* git push origin xxx | * git push origin xxx | ||
* git push origin xxx:yyy | * git push origin xxx:yyy | ||
* git checkout remote/origin/zzz | * git checkout remote/origin/zzz | ||
==Low Level Stuff== | |||
$ cd .git/reps/heads | $ cd .git/reps/heads | ||
Line 18: | Line 19: | ||
* git branch yesterday e79ff9e5926bd | * git branch yesterday e79ff9e5926bd | ||
=Remotes= | |||
* git | * 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 27: | Line 28: | ||
* git diff xxx origin/xxx | * git diff xxx origin/xxx | ||
=Broadcasting a Local Repo= | |||
* git serve | * git serve | ||
=Reviewing= | |||
* git log | * git log --graph --pretty=oneline | ||
* git log -- ../bin/chk_lrs.py | * git log -- ../bin/chk_lrs.py | ||
* git diff xxx origin/xxx | * git diff xxx origin/xxx --word-diff | ||
* git diff master^\^ origin/master | * git diff master^\^ origin/master --word-diff | ||
=After a Conflict= | |||
* git diff | * git diff | ||
* git checkout | * git checkout --ours -- the_file | ||
* git checkout | * git checkout --theirs -- the_file | ||
=Other= | |||
* git pull origin | * git pull origin +master:master | ||
* git reset -- HEAD | |||
* find dir -type f | xargs git reset | |||
Note, this will discard local changes | ==List Objects== | ||
* git rev-list --objects -g --no-walk --all | |||
Note, this will discard local changes! | |||
Also see - [[Git_SCM_Notes]] | [[Summary_of_Git_Commands]] | [[Getting Started with Git]] | |||
[[Category:Git]] | [[Category:Git]] | ||
[[Category:SCM]] | [[Category:SCM]] |
Latest revision as of 23:18, 3 November 2020
Also see - Git_SCM_Notes | Summary_of_Git_Commands | Getting Started with Git
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 remote -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
List Objects
- git rev-list --objects -g --no-walk --all
Note, this will discard local changes!
Also see - Git_SCM_Notes | Summary_of_Git_Commands | Getting Started with Git