-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure_git.sh
75 lines (65 loc) · 1.9 KB
/
configure_git.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/env bash
GLOBAL_IGNORE=~/.gitignore-global
# set up for me
git config --global user.email [email protected]
git config --global user.name dlovell
# customize
git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto
git config --global color.interactive auto
git config --global push.default simple
git config --global core.excludesfile $GLOBAL_IGNORE
# vim
git config --global core.editor vim
# vimdiff
git config --global diff.tool vimdiff
git config --global merge.tool vimdiff
git config --global difftool.prompt false
# git aliases
git config --global alias.lol "log --graph --decorate --pretty=oneline --abbrev-commit"
git config --global alias.lola "log --graph --decorate --pretty=oneline --abbrev-commit --all"
# password cacher
git config --global credential.helper 'cache --timeout=30'
# writing corresponding ignore
echo "__pycache__" >>$GLOBAL_IGNORE
# set up bash aliases; presumes ~/.bashrc sources ~/.bash_aliases
echo "\
# configure_git.sh
alias g='git'
alias gco='git checkout'
alias gpo='git push origin'
alias gcmp='gcm && gpo'
alias gcd='gco develop'
alias gb='git branch'
alias gba='gb -a'
alias ga='git add'
alias gai='git add -i'
alias gap='git add -p'
alias gau='git add -u'
alias gc='git commit'
alias gcm='git commit -m "Checkpoint commit."'
alias gpu='git push'
alias gpl='git pull'
alias gs='git status'
alias gd='git diff'
alias gdc='git diff --cached'
alias gg='git grep -n'
alias gds='git diff --staged'
alias gre='git checkout -- '
alias gus='git reset HEAD'
alias gll='git lol'
alias gla='git lola'
alias glp='git log -p'
alias gpod='gpo develop'
alias gpom='gpo master'
# git 'fuck it' (let's push it live)
alias gfi='git add -A && git commit -m \"Checkpoint.\" && git push'
gk() {
(gitk > /dev/null 2>&1) &
}
" >> ~/.bash_aliases_configure_git
echo "
# configure_git.sh
source ~/.bash_aliases_configure_git
" >> ~/.bash_aliases