by victorbello · 10y ago · 0 comments
Here's the code in case you wanted to use it:
savework()
{
if git diff --exit-code --quiet
then
echo "There are no changes to save, NONE!";
else
echo "Stage everything for commit -------------";
addit; # an alias for "git add -A ."
echo "Commit all changes with message $@ --------------";
commit "$@"; #commit is an alias for "git commit -m"
echo "Push branch to remote --------------"
psh; # an alias for git push origin $(git branch | grep "*" | sed "s/* //")
fi
}Use it like this: savework "COMMIT MESSAGE HERE"
saveallwork "commit message" --ignore "somedir/skipme.too"
I usually have just 1 or 2 files I don't want to include in a commit, but thank you again, it will definitely shave a few mins here and there.
Just curious -- do you squash commits when merging one of these feature branches?