Skip to content

Instantly share code, notes, and snippets.

@LosAlamosAl
Created July 18, 2023 23:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LosAlamosAl/910dac5dc0a66c69f5fd7cac518a11ed to your computer and use it in GitHub Desktop.
Save LosAlamosAl/910dac5dc0a66c69f5fd7cac518a11ed to your computer and use it in GitHub Desktop.
Create and delete Git(Hub) branches

Create a new local branch and push to remote (GitHub)

git checkout -b 1/delete-leftover-cruft
git push -u origin 1/delete-leftover-cruft

Delete local and remote (GitHub) branch

git branch -d 1/delete-leftover-cruft
git push origin -d 1/delete-leftover-cruft

Note that my naming convention is n/name where n is the issue number that the branch addresses and name is the name of the branch (closely related to the issue title).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment