Skip to content

Instantly share code, notes, and snippets.

@abhinavm24
Forked from muellerzr/make_pr
Created January 26, 2021 08:40
Show Gist options
  • Save abhinavm24/63b175fceb3bbab512060f2f36ddb760 to your computer and use it in GitHub Desktop.
Save abhinavm24/63b175fceb3bbab512060f2f36ddb760 to your computer and use it in GitHub Desktop.
Make a new pr from an existing cloned repository by simply doing `make_pr`
#!/bin/bash
echo "Setting up a new PR"
# Ask for username
echo "Please enter the original GitHub organization or username of the repository (the part of the URL after github.com/): "
read org
# Ask for repo
echo "Please enter the repository name: "
read name
#Ask for branch
read -e -p "Please enter the branch of the repository you wish to use: " -i "main" branch
git remote add upstream https://github.com/$org/$name
git remote update
git checkout upstream/$branch
#Ask for new branch name
echo "Please enter a new branch name to use: "
read new_branch
git checkout -b $new_branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment