Skip to content

Commit 83cbbd6

Browse files
committed
Add scripts to manage $HOME.
1 parent 23c34b1 commit 83cbbd6

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

Diff for: git-push-home

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
3+
# Assumes you have done:
4+
#
5+
# git remote add backup your-other-host:r/home.git
6+
7+
git push backup

Diff for: git-save-home

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
3+
# If you keep your home directory version-controlled, you likely don't
4+
# want to version every single file. Things like editor
5+
# configuration, notes files, and html are likely candidates, while
6+
# music, video, and random downloads are not. In order to accommodate
7+
# this scenario, you can ignore everything like so:
8+
#
9+
# $ more ~/.gitignore
10+
# *
11+
#
12+
# Then, force git-add to track files you care about. Unfortunately
13+
# with git-add you have to add a -f every time the file is modified.
14+
# I don't understand why since git is already tracking the contents.
15+
16+
MODIFIED=$(git status | grep modified | cut -d " " -f 3-)
17+
18+
if [ "x$MODIFIED" == x ]; then
19+
echo no changes
20+
else
21+
git add -f $MODIFIED \
22+
&& git commit -q -m "Save home." \
23+
&& git diff --stat head^
24+
fi

0 commit comments

Comments
 (0)