Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LIGHTRED='\033[1;31m'
- LIGHTGREEN='\033[1;32m'
- LIGHTCYAN='\033[1;36m'
- LIGHTGRAY='\033[0;37m'
- YELLOW='\033[1;33m'
- RED='\033[0;31m'
- LIGHTPURPLE='\033[1;35m'
- GREEN='\033[0;32m'
- NC='\033[0m'
- alias gl="git log --oneline"
- alias gto="git checkout"
- alias gc="git commit -m"
- alias gb="git branch"
- set_branch(){
- # checking if current directory is a git directory
- ls -ahl | grep .git$ 1>/dev/null
- if [ $? -eq 0 ]
- then
- branch=`git branch | grep \* | awk -F ' ' {'print $2'}`
- fi
- }
- ppmessage(){
- printf " LOCAL/${LIGHTCYAN}$branch ${YELLOW}$1 ${NC} origin/${LIGHTRED}$branch ${NC}\n"
- }
- # pull and push commands works for respective branch names
- pull(){
- set_branch
- ppmessage "<<<"
- git pull origin $branch
- }
- push(){
- set_branch
- ppmessage ">>>"
- git push origin $branch
- }
- hub(){
- repo=`git config --get remote.origin.url | awk -F ':' {'print $2'} | awk -F '.' {'print $1'} `
- set_branch
- echo `google-chrome "github.com/$repo/tree/$branch" 1>/dev/null 2>&1 &`
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement