Skip to content

Instantly share code, notes, and snippets.

@stand-sure
Created July 14, 2022 12:28
Show Gist options
  • Save stand-sure/ddf92b6e67ab7684e921d3dc11b937e3 to your computer and use it in GitHub Desktop.
Save stand-sure/ddf92b6e67ab7684e921d3dc11b937e3 to your computer and use it in GitHub Desktop.
Git porcelain repo catch-up
#! /bin/bash
# checkout-pull-prune.sh
branchName=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')
git checkout "$branchName" && \
git pull && \
git fetch --prune
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment