2021-10-01 07:08:00 -07:00
|
|
|
{
|
2022-05-22 04:10:29 -07:00
|
|
|
#xdg.configFile = {
|
|
|
|
# "git/config".source = ./config;
|
|
|
|
# "git/ignore".source = ./ignore;
|
|
|
|
# "git/attributes".source = ./attributes;
|
|
|
|
#};
|
2021-10-10 06:59:41 -07:00
|
|
|
|
2022-01-04 06:27:58 -08:00
|
|
|
programs.lazygit.enable = true;
|
|
|
|
|
2021-10-01 07:08:00 -07:00
|
|
|
programs.git = {
|
|
|
|
enable = true;
|
2022-05-22 04:10:29 -07:00
|
|
|
userName = "Anish Lakhwara";
|
|
|
|
userEmail = "anish+git@lakhwara.com";
|
|
|
|
delta.enable = true;
|
2022-07-09 03:19:34 -07:00
|
|
|
# TODO enable signing
|
2022-05-22 04:10:29 -07:00
|
|
|
|
|
|
|
ignores = [
|
|
|
|
"*~"
|
|
|
|
"*.*~"
|
|
|
|
"\\#*"
|
|
|
|
".\\#*"
|
|
|
|
"*.swp"
|
|
|
|
".*.sw[a-z]"
|
|
|
|
"*.un~"
|
|
|
|
".netrwhist"
|
|
|
|
".vim/*"
|
|
|
|
".DS_Store?"
|
|
|
|
".DS_Store"
|
|
|
|
".CFUserTextEncoding"
|
|
|
|
".Trash"
|
|
|
|
".Xauthority"
|
|
|
|
"thumbs.db"
|
|
|
|
"Thumbs.db"
|
|
|
|
"Icon?"
|
|
|
|
".ccls-cache/"
|
|
|
|
".sass-cache/"
|
|
|
|
"__pycache__/"
|
|
|
|
"*.class"
|
|
|
|
"*.exe"
|
|
|
|
"*.o"
|
|
|
|
"*.pyc"
|
|
|
|
"*.elc"
|
2022-07-09 03:19:34 -07:00
|
|
|
".nrepl-port"
|
|
|
|
".envrc"
|
|
|
|
".lsp/*"
|
|
|
|
".direnv/*"
|
|
|
|
".clj-kondo/*"
|
|
|
|
".cpcache/*"
|
2022-05-22 04:10:29 -07:00
|
|
|
];
|
2021-10-01 07:08:00 -07:00
|
|
|
|
|
|
|
extraConfig = {
|
|
|
|
pull.rebase = false;
|
2022-06-23 03:48:16 -07:00
|
|
|
init.defaultBranch = "main";
|
2021-10-01 07:08:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
aliases = {
|
|
|
|
a = "add -p";
|
|
|
|
co = "checkout";
|
|
|
|
cob = "checkout -b";
|
|
|
|
f = "fetch -p";
|
2022-05-22 04:10:29 -07:00
|
|
|
c = "commit -v";
|
2021-10-01 07:08:00 -07:00
|
|
|
p = "push";
|
2022-05-22 06:26:42 -07:00
|
|
|
# po = "push -u origin "; TODO push current branch to main
|
2021-10-01 07:08:00 -07:00
|
|
|
ba = "branch -a";
|
|
|
|
bd = "branch -d";
|
|
|
|
bD = "branch -D";
|
|
|
|
d = "diff";
|
|
|
|
dc = "diff --cached";
|
|
|
|
ds = "diff --staged";
|
|
|
|
r = "restore";
|
|
|
|
rs = "restore --staged";
|
|
|
|
st = "status -sb";
|
|
|
|
|
|
|
|
# reset
|
|
|
|
soft = "reset --soft";
|
|
|
|
hard = "reset --hard";
|
|
|
|
s1ft = "soft HEAD~1";
|
|
|
|
h1rd = "hard HEAD~1";
|
|
|
|
|
|
|
|
# logging
|
|
|
|
lg =
|
|
|
|
"log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit";
|
|
|
|
plog =
|
|
|
|
"log --graph --pretty='format:%C(red)%d%C(reset) %C(yellow)%h%C(reset) %ar %C(green)%aN%C(reset) %s'";
|
|
|
|
tlog =
|
|
|
|
"log --stat --since='1 Day Ago' --graph --pretty=oneline --abbrev-commit --date=relative";
|
|
|
|
rank = "shortlog -sn --no-merges";
|
2022-05-22 04:10:29 -07:00
|
|
|
authors = "authors | sort | uniq -c | sort -n";
|
|
|
|
ls = "log --graph --abbrev-commit --decorate --color=always --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) - %C(dim red)%an%C(reset)%C(bold yellow)%d%C(reset)' --all";
|
2021-10-01 07:08:00 -07:00
|
|
|
|
|
|
|
# delete merged branches
|
|
|
|
bdm = "!git branch --merged | grep -v '*' | xargs -n 1 git branch -d";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|