3 ms·
For the "create a local branch from a remote branch", a more sensible option is probably: git checkout -t origin/branch-name Other things that are useful:
by robmil 14y ago
For the "create a local branch from a remote branch", a more sensible option is probably:
git checkout -t origin/branch-name
Other things that are useful:
Push and track a branch at the same time:
git push -u origin foo
Merge a branch and always generate a merge commit, even if a fast-forward was possible:
git merge --no-ff foo
A condensed and useful status output:
git status -sb
Useful `git log` options:
--abbrev-commit
(Shows as short a commitish as possible)
--color-words
(Show word-level diffs in the same line, rather than as two whole -/+ lines)
--decorate
(Where a commit is also a ref (e.g. the latest commit on a branch), display that ref in the output)
- martin-adams 14y agoAwesome, thanks for the tips. I'll be sure to update the cheat sheet with the wealth of community knowledge!