3 ms·
A few that weren't mentioned below: git alias start 'checkout @{u} -B' All my branches track origin/master (rather than local master), which makes it easy t
by CGamesPlay 10y ago
A few that weren't mentioned below:
git alias start 'checkout @{u} -B'
All my branches track origin/master (rather than local master), which makes it easy to git push / git pull without extra arguments. This will checkout a new branch from whatever the current branch is tracking. Usage: `git start my-new-feature`
git alias track 'track = branch --set-upstream-to'
Sets up your current branch to track some other branch. Usage: `git track origin/master`.
git alias gcbr 'gcbr = !git branch --no-track --no-color --merged | sed 's/[ *]*//' | grep -v master | xargs -n1 git branch -d &> /dev/null || exit 0'
"Garbage Collect BRanches" will delete any branches which are already merged into your current branch (excluding master). Basically, any branch which is "safe" to delete. (This one has been handed down through the ages; I initially found it on the skeleton dotfiles when I started working at Facebook. Thanks, whoever!)
- brown9-2 10y agonitpick: I don't think you need --no-track in `branch --merged` as no branch is being created with that command.