Skip to content

Instantly share code, notes, and snippets.

@mebubo
Last active December 30, 2015 02:59
Show Gist options
  • Select an option

  • Save mebubo/7765884 to your computer and use it in GitHub Desktop.

Select an option

Save mebubo/7765884 to your computer and use it in GitHub Desktop.
#!/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