From 0c5b01b5f069da5044ab6b572a8d3c8ea0ad4449 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Tue, 13 Jun 2023 01:41:51 +0800 Subject: [PATCH] feat: update git's config --- home/base/git.nix | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/home/base/git.nix b/home/base/git.nix index caba6b11..fc38c49a 100644 --- a/home/base/git.nix +++ b/home/base/git.nix @@ -27,9 +27,9 @@ ]; extraConfig = { - pull = { - rebase = true; - }; + init.defaultBranch = "main"; + push.autoSetupRemote = true; + pull.rebase = true; # replace https with ssh url = { @@ -56,5 +56,22 @@ features = "side-by-side"; }; }; + + aliases = { + # common aliases + br = "branch"; + co = "checkout"; + st = "status"; + ls = "log --pretty=format:\"%C(yellow)%h%Cred%d\\\\ %Creset%s%Cblue\\\\ [%cn]\" --decorate"; + ll = "log --pretty=format:\"%C(yellow)%h%Cred%d\\\\ %Creset%s%Cblue\\\\ [%cn]\" --decorate --numstat"; + cm = "commit -m"; + ca = "commit -am"; + dc = "diff --cached"; + amend = "commit --amend -m"; + + # aliases for submodule + update = "submodule update --init --recursive"; + foreach = "submodule foreach"; + }; }; }