add .nbstripout
[epclust.git] / initialize.sh
... / ...
CommitLineData
1#!/bin/sh
2
3#initialize submodules, set-up .git/config and .gitattributes, and pre-push hook
4git submodule init && git submodule update --merge
5#filter for Jupyter
6python .nbstripout/nbstripout.py --install --attributes .gitattributes
7#filter for git-fat [TODO: idempotent...]
8printf '*.pdf filter=fat\n*.tar.xz filter=fat\n*.png filter=fat\n*.jpg filter=fat\n*.ps filter=fat\n' >> .gitattributes
9#pre-push hook: git fat push, submodules update
10printf '#!/bin/sh\n./.git-fat/git-fat pull\n./.git-fat/git-fat push\ngit submodule update --merge\n' > .git/hooks/pre-push
11chmod 755 .git/hooks/pre-push
12#.gitfat file with remote on gitfat@auder.net
13printf '[rsync]\nremote = gitfat@auder.net:~/files/edfclust\n' > .gitfat
14#manual git-fat init: with relative path to binary
15#1] remove filter if exists http://stackoverflow.com/questions/12179437/replace-3-lines-with-another-line-sed-syntax
16sed -i '1N;$!N;s/\[filter "fat"\]\n.*\n.*//;P;D' .git/config
17#2] place new filter
18printf '[filter "fat"]\n\tclean = ./.git-fat/git-fat filter-clean\n\tsmudge = ./.git-fat/git-fat filter-smudge\n' >> .git/config