add got-clean

This commit is contained in:
Aaron Bieber 2020-09-29 14:47:38 +00:00
parent f15c0035bd
commit 4203badd3a
2 changed files with 19 additions and 0 deletions

View File

@ -17,6 +17,24 @@ function got-sync {
got rebase master
}
function got-clean {
local _opt
_opt=$1
for f in $(got status | grep ^? | awk '{print $2}'); do
case "$_opt" in
-f)
rm -vf "$f"
;;
-i)
rm -vi "$f"
;;
*)
echo "rm $f"
;;
esac
done
}
function got-commit-v {
local _width _session _args

View File

@ -4,6 +4,7 @@ This extension adds helper functions to the [[https://gameoftrees.org/][got]] to
| Function | Description |
|-------------+-------------------------------------------------------------------------|
| ~got-clean~ | Cleans the work directory. |
| ~got-push~ | Pushes (~git push~) from the bare repository found in ~.got/repository~ |
| ~got-sync~ | Rebase ~master~ on top of ~[remote]/master~. Defaults to ~origin~. |
| ~__got_ps1~ | Current got branch. Intended to be used in ~$PS1~. |