-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitconfig
More file actions
42 lines (41 loc) · 1.21 KB
/
.gitconfig
File metadata and controls
42 lines (41 loc) · 1.21 KB
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
[user]
name = Tushar Khan
email = dev@tusharkhan.com
[init]
defaultBranch = main
[fetch]
prune = true
[pull]
rebase = true
[rebase]
autosquash = true
committerDateIsAuthorDate = true
[push]
autoSetupRemote = true
[alias]
# status
s = status -sb
# add
a = add
# commit with message
cm = commit -m
# unstaged changes
d = diff -w --word-diff=color --ignore-space-at-eol
# staged changes
ds = d --cached
# last commit changes
dc = d HEAD~1 HEAD
# pretty log
l = log --pretty='%C(yellow)%h%C(auto)%d %C(reset)%s %C(cyan)(%ad)%C(dim white) - %an%C(reset)' --graph --date=relative --date-order
# last 10 commits
ll = l -10
# change message of last commit, ignore staged files
reword = "!f() { GIT_COMMITTER_DATE=\"$(git show -s --format=%cI HEAD)\" git commit --amend --only --date \"$(git show -s --format=%aI HEAD)\" -m \"$1\"; }; f"
# add staged files to last commit, preserve message
amend = "!f() { GIT_COMMITTER_DATE=\"$(git show -s --format=%cI HEAD)\" git commit --amend --date \"$(git show -s --format=%aI HEAD)\" --no-edit; }; f"
# uncommit, keep changes
undo = reset --soft HEAD^
# unstage files, keep changes
unstage = restore --staged
# remove files from git, keep on disk
untrack = rm --cached