aboutsummaryrefslogtreecommitdiffstats
path: root/home/sadbeast/features/git.nix
diff options
context:
space:
mode:
authorsadbeast <sadbeast@sadbeast.com>2024-05-30 00:47:47 +0000
committersadbeast <sadbeast@sadbeast.com>2025-01-11 12:20:20 -0800
commit8c12d7db633cc421cd96690d077461cf45195334 (patch)
treec3112acb5cd045ceeb2ada81a281a5991b4c501d /home/sadbeast/features/git.nix
downloadnix-config-8c12d7db633cc421cd96690d077461cf45195334.tar.gz
nix-config-8c12d7db633cc421cd96690d077461cf45195334.tar.bz2
oh no what have i doneHEADmain
Diffstat (limited to 'home/sadbeast/features/git.nix')
-rw-r--r--home/sadbeast/features/git.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/home/sadbeast/features/git.nix b/home/sadbeast/features/git.nix
new file mode 100644
index 0000000..d4d588c
--- /dev/null
+++ b/home/sadbeast/features/git.nix
@@ -0,0 +1,30 @@
+{
+ config,
+ lib,
+ ...
+}: {
+ programs.git = {
+ enable = true;
+ userName = lib.mkDefault config.home.username;
+ userEmail = lib.mkDefault "sadbeast@sadbeast.com";
+
+ aliases = {
+ p = "pull --ff-only";
+ ff = "merge --ff-only";
+ graph = "log --decorate --oneline --graph";
+ add-nowhitespace = "!git diff -U0 -w --no-color | git apply --cached --ignore-whitespace --unidiff-zero -";
+ # for "last branch", shows the most recently accessed branches
+ lb = "!git reflog show --pretty=format:'%gs ~ %gd' --date=relative | grep 'checkout:' | grep -oE '[^ ]+ ~ .*' | awk -F~ '!seen[$1]++' | head -n 15 | awk -F' ~ HEAD@{' '{printf(\" \\033[33m%s: \\033[37m %s\\033[0m\\n\", substr($2, 1, length($2)-1), $1)}'";
+ };
+
+ extraConfig = {
+ init.defaultBranch = "main";
+ push.autoSetupRemote = true;
+ # Reuse merge conflict fixes when rebasing
+ rerere.enabled = true;
+ };
+ ignores = [".direnv"];
+
+ lfs.enable = true;
+ };
+}