| 12345678910111213141516171819202122232425262728293031 |
- 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-cleanup='git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d'
|