Created
March 2, 2018 12:31
-
-
Save gusenov/945d021fb46bd6daf0a3a38095c81811 to your computer and use it in GitHub Desktop.
Использование Git для резервного копирования содержимого папки в которой находится данный исполняемый bash-скрипт.
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
#!/bin/bash | |
set -x # echo on | |
if [ -d "./.git/" ] ; then | |
: | |
else | |
git init | |
git config --local user.name ' ' | |
git config --local user.email '<>' | |
git config --local core.quotepath false | |
fi | |
git add . | |
msg=$(date +"%Y%m%d_%H%M%S") | |
git commit -m "$msg" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment