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>2024-10-05 16:44:14 -0700
commit09513b5c4e4babfaefdd06c592ef34c0908dc572 (patch)
tree5a9af6ef0407346c223334e295adc8012654f112 /home/sadbeast/features/git.nix
downloadnix-config-main.tar.gz
nix-config-main.tar.bz2
oh god what have i doneHEADmain
Diffstat (limited to 'home/sadbeast/features/git.nix')
-rw-r--r--home/sadbeast/features/git.nix28
1 files changed, 28 insertions, 0 deletions
diff --git a/home/sadbeast/features/git.nix b/home/sadbeast/features/git.nix
new file mode 100644
index 0000000..477265b
--- /dev/null
+++ b/home/sadbeast/features/git.nix
@@ -0,0 +1,28 @@
+{
+ 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"];
+ };
+}