2023-04-05 20:14:06 +03:00
|
|
|
{pkgs, ...}: {
|
2020-08-02 22:29:14 +03:00
|
|
|
programs.git = {
|
|
|
|
enable = true;
|
2022-06-10 21:36:34 +03:00
|
|
|
extraConfig = {
|
|
|
|
pull.rebase = true;
|
|
|
|
safe.directory = "/etc/nixos";
|
2023-04-05 20:14:06 +03:00
|
|
|
diff.external = "${pkgs.difftastic}/bin/difft";
|
2022-06-10 21:36:34 +03:00
|
|
|
};
|
2021-05-07 01:02:40 +03:00
|
|
|
lfs.enable = true;
|
2020-08-02 22:29:14 +03:00
|
|
|
aliases = {
|
|
|
|
a = "add -p";
|
|
|
|
co = "checkout";
|
|
|
|
cob = "checkout -b";
|
|
|
|
f = "fetch -p";
|
|
|
|
c = "commit";
|
2021-05-07 01:02:40 +03:00
|
|
|
ps = "push";
|
|
|
|
pl = "pull";
|
|
|
|
rb = "rebase";
|
2020-08-02 22:29:14 +03:00
|
|
|
ba = "branch -a";
|
|
|
|
bd = "branch -d";
|
|
|
|
bD = "branch -D";
|
|
|
|
d = "diff";
|
|
|
|
dc = "diff --cached";
|
|
|
|
ds = "diff --staged";
|
2021-05-07 01:02:40 +03:00
|
|
|
rs = "restore";
|
|
|
|
rss = "restore --staged";
|
|
|
|
s = "status -sb";
|
|
|
|
ss = "stash";
|
|
|
|
ssp = "stash pop";
|
|
|
|
ssl = "stash list";
|
|
|
|
ssd = "stash drop";
|
2020-08-02 22:29:14 +03:00
|
|
|
# reset
|
2021-05-07 01:02:40 +03:00
|
|
|
rsoft = "reset --soft";
|
|
|
|
rhard = "reset --hard";
|
|
|
|
rs1ft = "soft HEAD~1";
|
|
|
|
rh1rd = "hard HEAD~1";
|
2020-08-02 22:29:14 +03:00
|
|
|
# logging
|
2022-03-09 23:55:02 +03:00
|
|
|
l = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit";
|
2022-02-18 20:31:01 +03:00
|
|
|
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";
|
2020-08-02 22:29:14 +03:00
|
|
|
rank = "shortlog -sn --no-merges";
|
|
|
|
# delete merged branches
|
|
|
|
bdm = "!git branch --merged | grep -v '*' | xargs -n 1 git branch -d";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|