Skip to content

Commit

Permalink
Merge branch 'master' of github.com:tomnomnom/dotfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
tomnomnom committed Jul 18, 2019
2 parents d989c8f + 02e08fe commit 9096484
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions scripts/git-dump
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
OUT_DIR="git-objects"

if [ ! -z "$1" ]; then
OUT_DIR="$1"
fi

if [ -d "$OUT_DIR" ]; then
echo "$OUT_DIR dir already exists"
exit 1
fi

mkdir -p "$OUT_DIR"
{
find .git/objects/pack/ -name "*.idx" | while read i; do
git show-index < "$i" | awk '{print $2}';
done;

find .git/objects/ -type f |
grep -v '/pack/' |
awk -F'/' '{print $(NF-1)$NF}';
} | while read o; do
git cat-file -p $o > "$OUT_DIR/$o"
done

0 comments on commit 9096484

Please sign in to comment.