This repository has been archived on 2022-02-10. You can view files and clone it, but cannot push or open issues/pull-requests.

54 lines
1.1 KiB
Executable File

#!/bin/sh -ex
fullpath() { echo "`pwd`/$1"; }
git init retro
cd retro
cp /usr/share/dict/words words.big
chmod u+w words.big
git add words.big
git commit -m'Add big file without using git-fat'
sort words.big > sorted.big
git add sorted.big
git commit -m'Add sorted file without using git-fat'
cat > .gitattributes <<EOF
original-attributes -text
git add .gitattributes
echo 'truncated' > words.big
git commit -am'Truncated words.big and add .gitattributes'
git fat init
cat > .gitattributes <<EOF
*.big filter=fat -text
git add .gitattributes
git checkout .
git commit -am'Import big files into git-fat'
git log --stat
git fat find 10000 | awk '{print $1}' > fat-files
git filter-branch --index-filter "git fat index-filter $(fullpath fat-files) --manage-gitattributes" --tag-name-filter cat -- --all
git log --stat
git checkout HEAD^
rm *
git checkout .
ls -al
# Set up place to push
git checkout master
cat > .gitfat <<EOF
remote = $(fullpath ../retro-store)
git add .gitfat
git commit -m'Add .gitfat for local push'
git fat push
cd ..
git clone file:///$(fullpath retro) retro-clone
cd retro-clone
git fat init
git fat pull