Skip to content

Commit

Permalink
feat: move git shell aliases to git config
Browse files Browse the repository at this point in the history
  • Loading branch information
datsfilipe committed Jan 10, 2025
1 parent 9267ccd commit 7bda6f0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
21 changes: 16 additions & 5 deletions home/base/core/git/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@
psm = "!git push origin $(git rev-parse --abbrev-ref HEAD)";
plm = "!git pull origin $(git rev-parse --abbrev-ref HEAD)";
lg = "log --graph --name-status --pretty=format:\"%C(red)%h %C(reset)(%cd) %C(green)%an %Creset%s %C(yellow)%d%Creset\" --date=relative";
changeb = "!f() { git rebase --onto=$1 $2 $(git symbolic-ref --short HEAD); }; f";
editu = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; vim `f`";
addu = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`";
chbase = "!f() { git rebase --onto=$1 $2 $(git symbolic-ref --short HEAD); }; f";
eu = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; vim `f`";
au = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`";
incc = "!(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u})";
outc = "!(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..)";

subup = "submodule update --init --recursive";
subfor = "submodule foreach";
sp = "submodule update --init --recursive";
sfor = "submodule foreach";
};

hooks = {
Expand All @@ -86,4 +86,15 @@
gitAndTools.ghq
gitAndTools.git-lfs
];

home.shellAliases = {
"g"="git";
"ga"="git add";
"gc"="git commit";
"gca"="git commit --amend";
"gr"="reset HEAD --";
"gu"="git checkout --";
"root"="cd \"$(git rev-parse --show-toplevel)\"";
"gg"="BYPASS_HOOKS=true git";
};
}
8 changes: 0 additions & 8 deletions home/base/core/shells/shellAliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@
"delc"="trash --cleanup";
"delca"="trash --cleanup-all";

"g"="git";
"ga"="git add";
"gc"="git commit";
"gca"="git commit --amend";
"gr"="git unstage";
"gu"="git undo";
"root"="cd \"$(git rev-parse --show-toplevel)\"";

"top"="btop -p 1";
"topp"="btop";

Expand Down

0 comments on commit 7bda6f0

Please sign in to comment.