In case one uses home-manager / home.nix
, one needs to set package = pkgs.gitFull
:
programs.git = {
enable = true;
userName = "Firstname Lastname";
userEmail = "email@example.com";
package = pkgs.gitFull;
};
Side note: One can also set more options if one wants to:
extraConfig = {
push = {
# Source: https://stackoverflow.com/a/72401899/873282
autoSetupRemote = true;
# Always push to the branch we pulled from
# See https://git-scm.com/docs/git-config#Documentation/git-config.txt-pushdefault for details
default = "current";
};
# Use SVN's ||| also in git - and remove matching lines in the conflict region
# See https://git-scm.com/docs/git-config#Documentation/git-config.txt-mergeconflictStyle for details
merge = { configStyle = "zdiff3"; };
# Colors in output
# Source: https://unix.stackexchange.com/a/44297/18033
color = { ui = "auto"; };
# Sort branches at "git branch -v" by committer date
branch = { sort = "-committerdate"; };
# tabs are 4 spaces wide
gui = { tabsize = 4; };
};