Last active
December 30, 2015 02:59
-
-
Save mebubo/7765884 to your computer and use it in GitHub Desktop.
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 | |
| REPOS=$HOME/txt/ | |
| save () { | |
| emacsclient -e "(save-some-buffers t (lambda () (derived-mode-p 'org-mode)))" | |
| } | |
| commit () { | |
| for REPO in $REPOS; do | |
| cd $REPO | |
| git ls-files --deleted -z | xargs --no-run-if-empty -0 git rm | |
| git add . | |
| git commit -m "Automatic snapshot created by $(basename $0)" | |
| done | |
| } | |
| push () { | |
| for REPO in $REPOS; do | |
| cd $REPO | |
| git pull origin master | |
| git push origin master | |
| done | |
| } | |
| save && commit && push |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment