Skip to content

Instantly share code, notes, and snippets.

@kas-cor
Last active January 9, 2019 12:44
Show Gist options
  • Save kas-cor/d00fd152bdf4f705979338129ca84253 to your computer and use it in GitHub Desktop.
Save kas-cor/d00fd152bdf4f705979338129ca84253 to your computer and use it in GitHub Desktop.
My bash alias
alias home='cd /c/OSPanel/domains/'
alias ls='ls -alh --color=auto'
alias g-pull='git pull origin master'
alias g-push='git push origin master'
# Code review
g-review() {
if [ "$1" = "" ]; then
echo Ex. review issues1234
else
if git checkout master ; then
if git fetch origin $1 ; then
git checkout -b $1 origin/$1
fi
fi
fi
}
g-merge() {
if [ "$1" = "" ]; then
echo Ex. merge issues1234
else
if git checkout master ; then
if git merge --no-ff $1 ; then
read -p "Delete local branch $1 (y/n) ?" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]] ; then
git branch -d $1
fi
read -p "Delete remote branch $1 (y/n) ?" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]] ; then
git push origin :$1
fi
fi
fi
fi
}
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
@kas-cor
Copy link
Author

kas-cor commented Jan 9, 2019

Using

Pull

g-pull

Push

g-push

Code review

g-review banch_name

Merge branch

g-merge branch_name

List files whit system files, hidden files and colories

ls

And only for me, go home

home

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