Git Push

Push current branch to origin and sync with remote updates; keywords: git, rebase. Use only on explicit request; before execution, review diffs and list impact scope.

gologo13 37dc104 879 B Updated

File contents

Git Push (sync with origin)

Overview

Push current branch to origin and sync with remote updates.

Steps

  1. Fetch and rebase onto latest main (optional but recommended)
    • git fetch origin
    • git rebase origin/main || git rebase --abort (if not on main, rebase your feature branch onto latest main)
  2. Push current branch
    • git push -u origin HEAD
  3. If push rejected due to remote updates
    • Rebase and push: git pull --rebase && git push

Notes

  • Prefer rebase over merge for a linear history.
  • If you need to force push after a rebase: you need to ask the user if they want to force push: git push --force-with-lease.

gologo13/agent-skills/tree/main/skills/git-push commit 37dc104b63

Frequently asked questions

npx skillmds@latest add gologo13/git-push