-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
44 lines (44 loc) · 1.67 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
[init]
defaultBranch = main
[user]
name = Rignchen
email = [email protected]
signingkey = ~/.ssh/id_ed25519
[alias]
# complex
get-url = !git remote get-url $(git config branch.$(git branch --show-current).remote) | sed 's/^[email protected]:/https:\\/\\/github.com\\//' | sed 's|git@ssh\\.dev\\.azure\\.com:v3/\\(.*\\)/\\(.*\\)/\\(.*\\)|https:\\/\\/dev.azure.com/\\1/\\2/_git/\\3|'
gh = !gh repo create $(basename $(pwd)) --public && git remote add origin [email protected]:Rignchen/$(basename $(pwd)) && git push -u origin main
sync = "!TEMP=$(git stash) && git pull && git push && if [ \"$TEMP\" != \"No local changes to save\" ]; then git stash pop; fi && echo \"Synced successfully\""
zip = !"declare FILENAME; if [ -z \"$1\" ]; then FILENAME=\"$(basename $(pwd))\"; else FILENAME=\"$1\"; fi; git archive --format=zip --output \"../$FILENAME.zip\" HEAD; #"
update = !BOB=$(git branch --show-current) && git checkout $1 && git pull && git checkout $BOB && git merge
temp = !"git add . && git stash save 'temp commit' && git checkout stash@{0}"
drop-ignored=!"TEMP=$(git stash) && git stash --all && git stash drop stash@{0} && if [ \"$TEMP\" != \"No local changes to save\" ]; then git stash pop; fi"
# simple
graph = log --all --graph --decorate --oneline
last = log -1 HEAD
undo = reset HEAD~1
unstage = restore --staged
# short
a = add . --patch
new = add -N
c = commit -m
ca = commit --amend --no-edit
d = diff -w
dc = diff --compact-summary
ds = d --staged
dv = difftool -y
dvs = dv --staged
s = status -s
sh = stash
[pull]
rebase = false
[gpg]
format = ssh
[push]
autoSetupRemote = true
[diff]
tool = vimdiff
[advice]
addEmptyPathspec = false
[merge]
tool = vimdiff