Skip to content

Instantly share code, notes, and snippets.

@davidfurlong
Last active December 22, 2021 12:20
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 davidfurlong/fec51dd1d851d117f81eca655fa6e51c to your computer and use it in GitHub Desktop.
Save davidfurlong/fec51dd1d851d117f81eca655fa6e51c to your computer and use it in GitHub Desktop.
[See newer patch.sh] Create a PR for a small uncommitted change with one command. Assumes dev is your main branch and that you have hub installed / use github for PRs
#!/bin/bash
timestamp=$(date +%Y-%m-%d-%H-%M-%S)
read -p "When merged, this commit will: " msg
git checkout -b patch-$timestamp &&
git add ../ &&
git commit -m "$msg" &&
hub pull-request -p -m "$msg" &&
git checkout dev &&
echo "Successfully commited, opened PR for branch $msg and switched back to dev"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment