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