[–] robmil 13y 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 13y ago ↗ Awesome, thanks for the tips. I'll be sure to update the cheat sheet with the wealth of community knowledge!
[–] martin-adams 13y ago ↗ Awesome, thanks for the tips. I'll be sure to update the cheat sheet with the wealth of community knowledge!
[–] isxek 13y ago ↗ Some common Git aliases would probably be a good addition, e.g., "git cm" for "git commit -m", or "git lol" for "log --graph --decorate --pretty=oneline --abbrev-commit". [–] martin-adams 13y ago ↗ Well what can I say, I hadn't come across git aliases before and looks to be very handy.
[–] martin-adams 13y ago ↗ Well what can I say, I hadn't come across git aliases before and looks to be very handy.
4 comments
[ 3.3 ms ] story [ 17.9 ms ] threadPush and track a branch at the same time:
Merge a branch and always generate a merge commit, even if a fast-forward was possible: A condensed and useful status output: Useful `git log` options: (Shows as short a commitish as possible) (Show word-level diffs in the same line, rather than as two whole -/+ lines) (Where a commit is also a ref (e.g. the latest commit on a branch), display that ref in the output)