Created
October 20, 2021 06:25
-
-
Save kougazhang/14eaf4c65c8f136c735efb356457cd55 to your computer and use it in GitHub Desktop.
#shell #git
This file contains hidden or 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
#!/usr/bin/env bash | |
# sync src to git repository. | |
# src is file | |
src=$1 | |
# dest is dir | |
dest=$2 | |
cp $src $dest | |
pushd $dest | |
isDiff=`git status -s` | |
if [ -z $isDiff ]; then | |
echo "no changes, exit." | |
exit 0 | |
fi | |
git add -A . | |
git commit -m "auto save" | |
git push origin master | |
popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment