3 ms·
I have a bunch, but one of my favorite is a fish shell function that writes wip commits: ``` function w #set --local staged (gs | cut -c1 | ag -v "\?" |
by hboon 3y ago
I have a bunch, but one of my favorite is a fish shell function that writes wip commits:
```
function w
#set --local staged (gs | cut -c1 | ag -v "\?" | string collect | string trim)
set --local staged (git status -s | grep "^[MADRCU]" | string collect | string trim)
if test -n "$staged"
#echo "something staged"
else
#echo "nothing staged"
git add .
end
if not string length -q -- "$argv"
gc -m 'WIP' -n
else
gc -m "$argv" -n
end
end
```
Lifesaver and timesaver.
I have one called `b` that creates a new branch and commits.
One called `poop` that pushes the current branch to GitHub and create a PR.
etc etc