Skip to content

Instantly share code, notes, and snippets.

@keyle
Created December 1, 2021 04:41
Show Gist options
  • Select an option

  • Save keyle/4241c1192cd934ba99306ae5a297435d to your computer and use it in GitHub Desktop.

Select an option

Save keyle/4241c1192cd934ba99306ae5a297435d to your computer and use it in GitHub Desktop.
update but first check for status change
update() {
git status --porcelain
if read -q "choice?stash changes? Y/y: "; then
echo ""
git stash
echo "-----------------------------------"
git pull --all
echo "-----------------------------------"
git stash pop
else
echo ""
git pull --all
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment