Created
December 11, 2018 13:56
-
-
Save ihincks/5256a9d7ca9b4c6d80043d522eb14b47 to your computer and use it in GitHub Desktop.
Saves a diff of the current working changes to a git repo into Dropbox (so that you can continue working on something somewhere else)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
timestamp() { | |
date +"%Y-%m-%d_%H:%M:%S" | |
} | |
pushd "$PWD" > /dev/null | |
SHA="$(git rev-parse --short HEAD)" | |
FILENAME="$HOME/Dropbox/diff/${PWD##*/}_$(timestamp)_$SHA.diff" | |
git diff > $FILENAME | |
echo "Saved diff to $FILENAME" | |
popd > /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment