Skip to content

Instantly share code, notes, and snippets.

@kylerberry
Last active August 29, 2015 14:11
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 kylerberry/dcdb750806556f1e9162 to your computer and use it in GitHub Desktop.
Save kylerberry/dcdb750806556f1e9162 to your computer and use it in GitHub Desktop.
# shorter status command
alias s='git status'
# add all unstaged changes
# commit with a message parameter
## example: ac "a commit message"
ac() {
git add -A && git commit -m "$1"
}
# add all unstaged changes
# commit with a message parameter
# push to origin in new branch matching current branch
## example: acp "a commit message"
acp() {
branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,');
if [ "$branch" != "develop" ]; then
git add -A && git commit -m "$1" && git push origin $branch;
else
echo "\nYou are trying to push from the develop branch, dum dum.\n\n"
fi
}
# creates a new branch with a name parameter
## example: new "branch-name"
new() {
git checkout -b $1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment