Skip to content

Instantly share code, notes, and snippets.

@daltonpearson
Last active June 28, 2018 21:32
Show Gist options
  • Save daltonpearson/cb002ebf9305355d4b30155d0dc48f17 to your computer and use it in GitHub Desktop.
Save daltonpearson/cb002ebf9305355d4b30155d0dc48f17 to your computer and use it in GitHub Desktop.
version-control-is-hard
Ryan and Dalton's: Add-Commit-Push
do
git config --global alias.acp '!f() { git checkout -b $1 ; git add . ; git commit -m "$2" ; git push -u origin $1; }; f'
Then you can just do
git acp "<branchname>" "<commit message>"
It will automatically create a branch, add the files, commit the changes and push the branch to remote
You can thank us later
@tuneis
Copy link

tuneis commented Jun 28, 2018

We're accepting donations. Unless this doesn't work on your machine. In that case, all blame goes to StackOverflow. ;)

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