3 ms·
All of my various git alises. I especially like `goops` which is very useful if you just pushed some code and realised you missed something. https://github.com
by K0nserv 8y ago
All of my various git alises. I especially like `goops` which is very useful if you just pushed some code and realised you missed something.
https://github.com/k0nserv/dotfiles/blob/7721559be40bba09cd89b9243907df254999cfdd/files/zshrc.symlink#L16-L24 https://github.com/k0nserv/dotfiles/blob/7721559be40bba09cd8...
alias gs="g status"
alias glff="git pull --ff-only"
alias glffc="git pull origin \$(current_branch) --ff-only"
alias glc="git pull origin \$(current_branch)"
alias gpc="git push origin \$(current_branch)"
alias gpcfl="git push origin \$(current_branch) --force-with-lease"
function goops { git add -A "$@" && git commit --amend --no-edit && gpcfl }
alias gbr="git branch -r"
alias grm="git branch --merged | grep -v \"\*\" | xargs -n 1 git branch -d"
function mkb() {
git fetch && git checkout -b "$1" origin/master
}
`mkdataenv` is nice for spinning up a quick Jupyter environment for all data analysis needs.
https://github.com/k0nserv/dotfiles/blob/7721559be40bba09cd89b9243907df254999cfdd/files/zshrc.symlink#L74-L82 https://github.com/k0nserv/dotfiles/blob/7721559be40bba09cd8...
function mkdataenv() {
mkvirtualenv --python /usr/local/bin/python3 $1
workon $1
mkdir "$1"
cd $1
pip install pandas jupyter numpy matplotlib seaborn
pip freeze > requirements.txt
jupyter notebook
}
- 0x00101010 8y agogit aliases is best done with git itself, e.g. my favorite git alias is `git alias`, which lists all my git aliases. alias.alias config --global --get-regexp ^alias I really like blameconflict: alias.blameconflict blame -L '/^<<<</,/^>>>>/'
- K0nserv 8y agoI've never liked git aliases, at least not for things I do frequently.
- 0x00101010 8y agoWith Z-Shell git aliases have tab completion which is really nice. My workflow often involves something like g fp # git fetch --prune ... g rb origin/master master # rebase g co - A lot of tab and very few keys in general when working with git. My favorite aliases in this context are alias wow=git alias such=git alias many=git alias awesome=git alias much=git