-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgit.nix
34 lines (34 loc) · 998 Bytes
/
git.nix
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
{
programs.git = {
enable = true;
userName = "Ju Liu";
userEmail = "liuju86@gmail.com";
ignores = [ "*~" ".DS_Store" ".direnv" ".env" ".rgignore" ];
extraConfig = {
init = { defaultBranch = "main"; };
pull = { ff = "only"; };
};
delta = { enable = true; };
aliases = {
ci = "commit";
co = "checkout";
di = "diff";
dc = "diff --cached";
addp = "add -p";
shoe = "show";
st = "status";
unch = "checkout --";
br = "checkout";
bra = "branch -a";
newbr = "checkout -b";
rmbr = "branch -d";
mvbr = "branch -m";
cleanbr =
"!git remote prune origin && git co master && git branch --merged | grep -v '*' | xargs -n 1 git branch -d && git co -";
as = "update-index --assume-unchanged";
nas = "update-index --no-assume-unchanged";
al = "!git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /'";
pub = "push -u origin HEAD";
};
};
}