|
|
@@ -0,0 +1,27 @@
|
|
|
+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 $(printf ", %s" "${@:2}")]"
|
|
|
+ fi
|
|
|
+ git add .gitignore
|
|
|
+ git commit -m "${message}"
|
|
|
+}
|
|
|
+
|
|
|
+alias git-graph="git log --graph --pretty=oneline --abbrev-commit --decorate --all"
|
|
|
+
|