feat(git): add alias to commit with previous message

This commit is contained in:
oddlama 2023-09-18 01:20:59 +02:00
parent ef85bdc5a9
commit 94270f34e8
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A

View file

@ -21,16 +21,19 @@
t = "tag -s -m ''"; t = "tag -s -m ''";
ci = "commit -v -S"; ci = "commit -v -S";
cam = "commit -v -S --amend"; cam = "commit -v -S --amend";
fixup = ''!f() { TARGET=$(git rev-parse \"$1\"); git commit --fixup=$TARGET ''${@:2} && EDITOR=true git rebase -i --gpg-sign --autostash --autosquash $TARGET^; }; f''; fixup = ''!f() { TARGET=$(git rev-parse "$1"); git commit --fixup=$TARGET ''${@:2} && EDITOR=true git rebase -i --gpg-sign --autostash --autosquash $TARGET^; }; f'';
commit-reuse-message = ''!git commit --edit --file "$(git rev-parse --git-dir)"/COMMIT_EDITMSG'';
cir = "commit-reuse-message -v -S";
}; };
}; };
home.shellAliases = rec { home.shellAliases = rec {
g = "gitui"; g = "gitui";
gs = "git status";
ga = "git add"; ga = "git add";
gc = "git commit -v -S"; gc = "git ci";
gca = "${gc} --amend"; gca = "git ci --amend";
# TODO command to make new commit with old commit editmsg, beware worktrees have different path gcl = "git clone";
gcr = "git cir";
gs = "git s";
}; };
} }