I'm using zsh's git
plugin for the alias like gp
.
- Check out the
master/main
(default) branch for the repo and pull the latest changes.
DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch" | sed 's/.*: //') && \
git checkout "$DEFAULT_BRANCH" && \
git pull origin "$DEFAULT_BRANCH"