From 344ed305c596490c8840ae75fda3d8da540ccd2b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 5 Oct 2020 17:00:17 -0400 Subject: [PATCH] Improve git config + Replace 'git browse' (hub-only) with git-open + Add URL aliases for github, gist and gitlab + Replace 'git branch' alias with 'git branch -av' --- config/git/aliases.zsh | 4 ++-- config/git/config | 12 ++++++++++++ modules/shell/git.nix | 1 + 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/config/git/aliases.zsh b/config/git/aliases.zsh index 708fedf5..35eaa2d3 100644 --- a/config/git/aliases.zsh +++ b/config/git/aliases.zsh @@ -5,8 +5,8 @@ g() { [[ $# = 0 ]] && git status --short . || git $*; } alias git='noglob git' alias ga='git add' alias gap='git add --patch' -alias gb='git branch' -alias gbr='git browse' +alias gb='git branch -av' +alias gop='git open' alias gbl='git blame' alias gc='git commit' alias gcm='git commit -m' diff --git a/config/git/config b/config/git/config index 7e532c34..8e503fe4 100644 --- a/config/git/config +++ b/config/git/config @@ -29,3 +29,15 @@ smudge = git-lfs smudge -- %f process = git-lfs filter-process clean = git-lfs clean -- %f +[url "https://github.com/"] + insteadOf = gh: +[url "git@github.com:hlissner/"] + insteadOf = gh:/ +[url "https://gitlab.com/"] + insteadOf = gl: +[url "https://gist.github.com/"] + insteadOf = gist: +[url "https://bitbucket.org/"] + insteadOf = bb: +[url "https://git.v0.com"] + insteadOf = v0: diff --git a/modules/shell/git.nix b/modules/shell/git.nix index 419d5edb..3429d21e 100644 --- a/modules/shell/git.nix +++ b/modules/shell/git.nix @@ -11,6 +11,7 @@ in { config = mkIf cfg.enable { user.packages = with pkgs; [ gitAndTools.gh + gitAndTools.git-open gitAndTools.diff-so-fancy (mkIf config.modules.shell.gnupg.enable gitAndTools.git-crypt)