Last active
August 29, 2015 14:11
-
-
Save kylerberry/dcdb750806556f1e9162 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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