Skip to content

Instantly share code, notes, and snippets.

@srsholmes
Created October 13, 2022 12:13
Show Gist options
  • Save srsholmes/7e542686402f50e740ff5f7d5c1278d9 to your computer and use it in GitHub Desktop.
Save srsholmes/7e542686402f50e740ff5f7d5c1278d9 to your computer and use it in GitHub Desktop.
Git add, commit and push all in one line.
function p() {
bnch=$(git branch | grep \* | cut -d ' ' -f2)
git add . && git commit -m "$1" && git push -u origin $bnch
}
# Usage: p 'here is a commit message'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment