forked from ryanb/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitconfig.erb
39 lines (39 loc) · 1.3 KB
/
gitconfig.erb
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
[user]
name = <%= print("Your Name: "); STDOUT.flush; STDIN.gets.chomp %>
email = <%= print("Your Email: "); STDOUT.flush; STDIN.gets.chomp %>
signingkey = <%= ENV['HOME'] %>/.ssh/signing-key.pub
[alias]
co = checkout
tagcommit = !sh -c 'git rev-list -1 $0'
rrm = !git status | grep deleted | awk '{print $3}' | xargs git rm
resurrect = "!sh -c 'git checkout $(git rev-list -n 1 HEAD -- \"$1\")^ -- \"$1\"' "
pf = push --force-with-lease
# https://stackoverflow.com/questions/3161204/how-to-find-the-nearest-parent-of-a-git-branch
parent = "!git show-branch | grep '*' | grep -v \"$(git rev-parse --abbrev-ref HEAD)\" | head -n1 | sed 's/.*\\[\\(.*\\)\\].*/\\1/' | sed 's/[\\^~].*//' #"
# https://stackoverflow.com/a/35075021/845546
adog = log --all --decorate --oneline --graph
[color]
diff = auto
status = auto
branch = auto
[core]
excludesfile = <%= ENV['HOME'] %>/.gitignore
autocrlf = input
[apply]
whitespace = nowarn
[format]
pretty = %C(yellow)%h%Creset %s %C(red)(%an, %cr)%Creset
[github]
user = <%= print("GitHub Username: "); STDOUT.flush; STDIN.gets.chomp %>
token = <%= print("GitHub API Token: "); STDOUT.flush; STDIN.gets.chomp %>
[push]
default = simple
[status]
short = true
branch = true
[gpg]
format = ssh
[commit]
gpgsign = true
[init]
defaultBranch = main