Commit 167ed30dfd0c

Vincent Demeester <vincent@sbr.pm>
2026-06-09 23:06:33
feat(git): add recommended git core dev settings
Added fetch pruning, commit verbose, zdiff3 conflict style, rebase autoStash/updateRefs, tag version sorting, diff mnemonicPrefix/renames, and rerere autoupdate based on GitButler's blog post on how core git devs configure git.
1 parent d911daa
Changed files (1)
home
common
shell
home/common/shell/git.nix
@@ -121,9 +121,11 @@ in
       };
       commit = {
         gpgSign = enableGpgSign;
+        verbose = true;
       };
       tag = {
         gpgSign = enableGpgSign;
+        sort = "version:refname";
       };
       init = {
         defaultBranch = "main";
@@ -157,10 +159,16 @@ in
       # fetch = {
       #   writeCommitGraph = true;
       # };
+      fetch = {
+        prune = true;
+        pruneTags = true;
+      };
       diff = {
         algorithm = "histogram";
         colormoved = "default";
         colormovedws = "allow-indentation-change";
+        mnemonicPrefix = true;
+        renames = true;
         # external = "difft";
         # tool = "difftastic";
       };
@@ -186,8 +194,12 @@ in
       forge = {
         remote = "upstream";
       };
+      merge = {
+        conflictstyle = "zdiff3";
+      };
       rerere = {
         enabled = true;
+        autoupdate = true;
       };
       hub = {
         protocol = true;
@@ -201,6 +213,8 @@ in
       };
       rebase = {
         autosquash = true;
+        autoStash = true;
+        updateRefs = true;
       };
       status = {
         short = true;