Bureaucrats, confirmed, Administrators
4,558
edits
(hack about file modes) |
(more log and branch examples) |
||
Line 62: | Line 62: | ||
* list the branches that are on remotes <code>git branch -r --list</code> | * list the branches that are on remotes <code>git branch -r --list</code> | ||
* checkout a remote branch, setting the local one to track <code>git checkout -t freephile/patch-1</code> | * checkout a remote branch, setting the local one to track <code>git checkout -t freephile/patch-1</code> | ||
* git branch --merged (while on master) shows you branches which are fully contained in HEAD, and can be deleted. | |||
== Comparing Branches == | |||
What's in this old branch, not in my new branch (ignoring merges)? | |||
* git log oldbranch ^newbranch --no-merges | |||
* git log master..feature (everything on the feature branch that is not in master) | |||
* git log origin/master..HEAD (everything in the local branch that you would push) | |||
* git log --left-right master...experiment (triple dot shows everything since the common ancestor) <ref>https://git-scm.com/book/en/v2/Git-Tools-Revision-Selection#Commit-Ranges</ref> | |||
== Don't merge, Rebase! == | == Don't merge, Rebase! == |