UPGRADE git config by adding alias

This commit is contained in:
Alexandre LUCAZEAU 2023-07-23 11:38:03 +02:00
parent a1525be05a
commit d78f9fdf35
1 changed files with 61 additions and 0 deletions

61
modules/git.nix Normal file
View File

@ -0,0 +1,61 @@
{ config, pkgs, ... }:
{
programs.git = {
enable = true;
userEmail = "alexandre@dri.fr";
userName = "Alexandre LUCAZEAU";
aliases = {
ignore = "!gi() { curl -sL https://www.toptal.com/developers/gitignore/api/$@ ;}; gi";
aa = "add --all";
b = "branch -v";
bd = "branch -d";
bD = "branch -D";
br = "branch";
ci = "commit";
cim = "commit -m";
cima = "commit -am";
clr = "rm -r --cached";
co = "checkout";
cp = "cherry-pick -x";
d = "diff -w";
dc = "diff --cached";
nb = "checkout -b";
oups = "commit --amend --no-edit";
r = "remote -v";
rh = "reset --hard";
st = "status -sb";
t = "tag -l";
unstage = "reset HEAD";
uncommit = "reset --soft HEAD^";
pushfl = "push --force-with-lease";
lg = "lg1";
lg1 = "lg1-specific --all";
lg2 = "lg2-specific --all";
lg3 = "lg3-specific --all";
};
extraConfig = {
"color" = {
"ui" = true;
};
"init" = {
defaultBranch = "main";
};
"color \"diff-highlight\"" = {
oldNormal = "red bold";
oldHighlight = "red bold 52";
newNormal = "green bold";
newHighlight = "green bold 22";
};
"color \"diff\"" = {
meta = 11;
frag = "magenta bold";
commit = "yellow bold";
old = "red bold";
new = "green bold";
whitespace = "red reverse";
};
};
signing.key = "3C8ADB07A8217BD3";
signing.signByDefault = false;
};
}