-
Notifications
You must be signed in to change notification settings - Fork 1
/
set-git-config.sh
51 lines (43 loc) · 1.23 KB
/
set-git-config.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
if [ "$1" = "" ]; then
echo "Empty name parameter"
if [ "$2" = "" ]; then
echo "Empty email parameter"
exit 1
fi
exit 1
fi
# Identity #
############
git config --global --unset-all user.name
git config --global user.name $1
git config --global --unset-all user.email
git config --global user.email $2
# Color #
########
git config --global color.branch auto
git config --global color.diff auto
git config --global color.interactive auto
git config --global color.status auto
git config --global color.ui always
# Core #
########
git config --global core.excludesfile $PWD/.gitexcludes
# Push Default #
################
# nothing do not push anything.
# matching push all matching branches. All branches having the same name in both ends are considered to be matching. This is the default.
# tracking push the current branch to its upstream branch.
# current push the current branch to a branch of the same name.
git config --global push.default current
# Push Default #
################
git config --global branch.master.remote origin
git config --global branch.master.merge refs/heads/master
# Branch #
##########
#git config --global branch.autosetuprebase always
# Show result #
###############
git config --global --list
exit 0