Skip to content

Instantly share code, notes, and snippets.

Created January 24, 2021 05:44
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Make a new pr from an existing cloned repository by simply doing `make_pr`
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 "
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$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
Copy link

To use, copy this into your /bin/ directory, and then run make_pr in an active git repository you want to use that is out of sync with the master/main branch

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