-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
72 lines (72 loc) · 1.7 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
[user]
email = [email protected]
name = Prajwal S N
signingkey = 60701A603988FAC2
[url "[email protected]:"]
insteadOf = "gh:"
insteadOf = "https://github.com/"
[init]
defaultBranch = main
[commit]
gpgsign = true
[alias]
a = add
b = "!SUCCESS=$(git switch $1 2>&1); \
if [[ $SUCCESS == *\"invalid reference\"* && ! -z $1 ]]; then \
read -e -n 1 -p \"Create new branch $1 [Y/n]? \" CHOICE; \
if [[ $CHOICE != \"n\" ]]; then \
git switch -c $1; \
fi \
else \
echo $SUCCESS; \
fi #"
bd = "!if [[ $(git branch -l $1) ]]; then \
read -e -n 1 -p \"Delete branch $1 [Y/n]? \" CHOICE; \
if [[ $CHOICE = \"y\" ]]; then \
git branch -D $1; \
fi; \
read -e -n 1 -p \"Delete remote branch $1 [Y/n]? \" CHOICE; \
if [[ $CHOICE = \"y\" ]]; then \
git push -d origin $1; \
fi; \
else \
echo \"Branch $1 does not exist\"; \
fi #"
bl = blame
br = branch -a
cl = clone
fork = "!git clone $1 && git remote add upstream $2 #"
cm = commit -s
cma = commit --amend
cman = commit --amend --no-edit
d = diff
l = log
lo = log --oneline
pl = pull
ps = push
pf = push --force-with-lease
rb = "!git rebase -i HEAD~$1 #"
rbm = "!BRANCH=$(git rev-parse --abbrev-ref origin/HEAD | cut -d/ -f2); \
git switch $BRANCH && \
git pull && \
git switch - && \
git rebase $BRANCH #"
rba = rebase --abort
rbc = rebase --continue
rs = reset --soft HEAD~1
s = status
st = stash
sp = stash pop
up = "!BRANCH=$(git rev-parse --abbrev-ref origin/HEAD | cut -d/ -f2); \
git switch $BRANCH && \
git pull upstream $BRANCH && \
git push && \
git switch - #"
[push]
autoSetupRemote = true
[pull]
rebase = true
[core]
editor = nvim
[http]
cookiefile = /home/snprajwal/.gitcookies