|
@@ -1,4 +1,22 @@
|
1
|
1
|
#!/bin/sh
|
2
|
2
|
|
3
|
|
-echo "[include]">>~/.gitconfig
|
4
|
|
-echo " path = ~/.git-universe/gitconfig">>~/.gitconfig
|
|
3
|
+gitver=`git --version | cut -d ' ' -f 3`
|
|
4
|
+
|
|
5
|
+if [ "$gitver" > "1.8" ]; then
|
|
6
|
+ tilde='~'
|
|
7
|
+else
|
|
8
|
+ tilde=$HOME
|
|
9
|
+fi
|
|
10
|
+
|
|
11
|
+host=`hostname`
|
|
12
|
+user=`whoami`
|
|
13
|
+
|
|
14
|
+conf=""
|
|
15
|
+conf="${conf}[include]"
|
|
16
|
+conf="${conf} path = $tilde/.git-universe/gitconfig-before"
|
|
17
|
+conf="${conf} path = $tilde/.git-universe/host/$host.gitconfig"
|
|
18
|
+conf="${conf} path = $tilde/.git-universe/user/$user.gitconfig"
|
|
19
|
+conf="${conf} path = $tilde/.git-universe/gitconfig-after"
|
|
20
|
+
|
|
21
|
+echo $conf >> ~/.gitconfig
|
|
22
|
+
|