Skip to content

Instantly share code, notes, and snippets.

@krmckone
Last active June 14, 2024 15:54
Show Gist options
  • Save krmckone/638e1bf8cdd195f8cb96896fdc85b476 to your computer and use it in GitHub Desktop.
Save krmckone/638e1bf8cdd195f8cb96896fdc85b476 to your computer and use it in GitHub Desktop.
Updates current branch from main and pushes
git fetch --prune
this_branch=$(git rev-parse --abbrev-ref HEAD)
git checkout main && git pull origin main && git checkout $this_branch && git pull origin main && git push
unset this_branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment