config/git: add unamend script

This commit is contained in:
xeruf 2021-12-02 12:47:04 +01:00
parent 891663aea0
commit fe92ab8fff
2 changed files with 6 additions and 1 deletions

View File

@ -9,7 +9,7 @@ y() {
yc() {
local folder="${1:-${PWD/$XDG_CONFIG_HOME\/}}"
echo "config/$folder:" >/tmp/yc-msg
yadm commit -v --template /tmp/yc-msg ${@:2} -- "$XDG_CONFIG_HOME/$folder"*
yadm commit -v --template /tmp/yc-msg ${@:2} -- "$XDG_CONFIG_HOME/$folder*"
}
gcn() {

5
.local/bin/scripts/git-unamend Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
# Remove the given files from the last commit
#git diff -p HEAD~ -- "$@" | git apply --reverse --cached
git reset HEAD~ "$@"
git commit --amend