Skip to content

Instantly share code, notes, and snippets.

@chuckntaylor
Last active April 10, 2024 13:39
Show Gist options
  • Save chuckntaylor/9231bbf8ca2e90248b65d65b222ae818 to your computer and use it in GitHub Desktop.
Save chuckntaylor/9231bbf8ca2e90248b65d65b222ae818 to your computer and use it in GitHub Desktop.
Git branch commands

Common Git Branch Commands

A collection of git commands that I commonly use, but can never remember.

Pushing a new branch to a remote repository

git push -u origin branchName

How to Delete a Git Branch Both Locally and Remotely

# Delete the local branch
git branch -d branchName

# Delete the remote branch
git push origin --delete branchName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment