-
Notifications
You must be signed in to change notification settings - Fork 2
/
gitconfig
50 lines (46 loc) · 1.66 KB
/
gitconfig
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
[core]
editor =
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
[init]
defaultBranch =
[user]
name =
email =
username =
[github]
user =
token = token
[commit]
template = ~/dotfiles/git-message-template.txt
[pull]
rebase = false
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[alias]
# Simple aliases
stick = log --oneline --decorate --graph --all -n 30 # my prefered version of git log
longStick = log --oneline --decorate --graph --all # my prefered version of git log with extra length
stat = status # short version of status
com = commit # short version of commit
ca = commit -a # add and commit at once
fix-commit = commit --edit --file=.git/COMMIT_EDITMSG
# More complex aliases
check = "!f() { \
Repo-check-updates.sh; \
}; f"
new = !sh -c 'git log $1@{1}..$1@{0} "$@"' #Show commits created by last command
edit = "!f() { \
/Users/Bob/Applications/Visual\\ Studio\\ Code.app/Contents/Resources/app/bin/code $(git status --short | awk '$1 ~ /^M|A|U/ {print $2}' ); \
}; f" #opens all unstaged files for editing in VS Code
hub = "!f() { \
if [[ "$OSTYPE" == "darwin"* ]]; then \
git remote -v | grep [email protected] | grep fetch | head -1 | cut -f2 | cut -d' ' -f1 | sed -e's,:,/,' -e 's,git@,http://,' | xargs open; \
else \
git remote -v | grep [email protected] | grep fetch | head -1 | cut -f2 | cut -d' ' -f1 | sed -e's,:,/,' -e 's,git@,http://,'; \
fi; \
}; f"
[include] #get gpg info
path = /path/to/local/config/file