| 1234567891011121314151617181920212223242526272829303132 |
- git-ignore() {
- local site="https://raw.githubusercontent.com/github/gitignore/master"
- if [[ $1 == "--global" ]]; then
- shift
- ignore_file=${HOME}/.gitignore_global
- site+="/Global"
- else
- ignore_file="./.gitignore"
- fi
- wget -qO- "${site}/${1}.gitignore" >> "${ignore_file}"
- }
- git-create() {
- mkcd "${1}"; shift
- git init
- touch .gitignore
- local message="Initializing repository"
- if [[ $# -ge 1 ]]; then
- for i in "$@"; do git-ignore "${i}"; done
- message+=" with ignore lists: [ $1"
- [[ $# -eq 1 ]] || message+="$(printf ", %s" "${@:2}")"
- message+=" ]"
- fi
- maybe_do git-ignore-local
- git add .gitignore
- git commit -m "${message}"
- }
- alias git-graph="git log --graph --pretty=oneline --abbrev-commit --decorate --all"
- alias git-history-graph="git log --graph --pretty='format:%C(auto)%h (%<(50,trunc)%s, %ad)%d' --abbrev-commit --decorate --all"
- alias git-cleanup='(git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d); (git fetch --prune 2>&1 | grep deleted | sed "s/.*-> origin\///" | xargs git branch -D)'
|