Skip to content

Instantly share code, notes, and snippets.

@mr-pascal
Last active June 12, 2022 06:44
Show Gist options
  • Save mr-pascal/682f9bfa162b3d04109813b3aa3f222e to your computer and use it in GitHub Desktop.
Save mr-pascal/682f9bfa162b3d04109813b3aa3f222e to your computer and use it in GitHub Desktop.
#!/bin/bash
## Create new local branch and push to remote
git co -b branch1
git push --set-upstream origin branch1
## Create new local branch and push to remote
git co -b branch2
git push --set-upstream origin branch2
## Create new local branch and DON'T push to remote
git co -b branch3
## Switch back to main
git co main
## Delete remote branch 2
git push origin --delete branch2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment