done
Switch from a feature branch to the latest code in a base branch (defaults to dev), and delete branches which are fully merged into that branch. This alias is intended for use after pushing a code-complete feature branch to the server, when ready to start a new feature based on the latest branch code. Pass an optional branch name to use a different base branch (e.g. git done main).
Usage:
git done [branch]
CLI Command
git config --global alias.done "!f() { branch=${1:-dev}; git fetch && git checkout "$branch" && git pull && git merged && git status; }; f"
.gitconfig Snippet
[alias]
done = !f() { branch=${1:-dev}; git fetch && git checkout "$branch" && git pull && git merged && git status; }; f