alias gp='git push'
alias glog='git log'
alias gs='git status'
# for easy git committing
function gc() {
git commit -m "$*"
}
Because alias doesn't accept parameters, function gc() allows you to type in something like:
gc this is my commit
Or for a bash script that commits and pushes to server, you could write:
echo "Please type commit message"read commit_messagegit commit -am "$commit_message"git push"Pushing onto repo"
Also, essential for aliasing is:
alias bashrc='mvim ~/.bashrc && source ~/.bashrc'
This will let you edit bashrc and then source it automatically afterwards.
As I commit pretty often, these aliases have saved me quite a bit of time.
No comments:
Post a Comment