Skip to content

Instantly share code, notes, and snippets.

@gusenov
Created March 2, 2018 12:31
Show Gist options
  • Save gusenov/945d021fb46bd6daf0a3a38095c81811 to your computer and use it in GitHub Desktop.
Save gusenov/945d021fb46bd6daf0a3a38095c81811 to your computer and use it in GitHub Desktop.
Использование Git для резервного копирования содержимого папки в которой находится данный исполняемый bash-скрипт.
#!/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