-
-
Save ratopi/a0401edafbd9376f7ecc to your computer and use it in GitHub Desktop.
Backup with 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
#!/bin/bash | |
# Set GIT_DIR and GIT_WORK_TREE before calling it! | |
# | |
# export GIT_DIR=/tmp/BUWG/x.git | |
# export GIT_WORK_TREE=/tmp/BUWG/test/ | |
b="backup-$( date '+%Y%m%d-%H%M%S' )" | |
git checkout --orphan "$b" | |
git add . | |
git commit -m "$b" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment