Blob is a Binary Large Object. All the files stored in a repo are blobs.
Blobs do not
store filenames, only content.
C-c on the property string first!
execute it first
case $(pwd) in
,*git_lab_1*)
cd ..
rm -rf git_lab_1
mkdir git_lab_1
cd git_lab_1
pwd
ls -al
;;
,*)
echo "You're in a wrong directory pal: $(pwd)."
;;
esac
/Users/allarm/Tmp/git_lab_1 total 0 drwxr-xr-x 2 allarm staff 64 Nov 10 18:14 . drwxr-xr-x 24 allarm staff 768 Nov 10 18:14 ..
echo "Hello world!" > hello.txt
echo "Goodbye world :(" > goodbye.txt
git init
git add .
git commit -m "First commit"
Initialized empty Git repository in /Users/allarm/Tmp/git_lab_1/.git/ [master (root-commit) 47e76e5] First commit 2 files changed, 2 insertions(+) create mode 100644 goodbye.txt create mode 100644 hello.txt
Now let's get the file objects:
objects=$(find .git/objects -type f | awk -F"/" '{print $3$4}')
for o in $objects
do
echo "$o : $(git cat-file -t $o)"
done
c12fddafdaba3b7b1281f50c9e482ed673f1767c : blob cd0875583aabe89ee197ea133980a9085d08e497 : blob 47d9d5e85fd40a8dc8fa4a1eeba8520b239c5ab4 : tree 47e76e5d09a5755fa684dcf0695928536f746346 : commit
Let's take a loot at the contents of the blobs.
objects=$(find .git/objects -type f | awk -F"/" '{print $3$4}')
for o in $objects
do
type=$(git cat-file -t $o)
if [ $type == "blob" ]
then
echo "[ $o : $type ]"
echo
git cat-file -p $o
echo
fi
done
[ c12fddafdaba3b7b1281f50c9e482ed673f1767c : blob ] Goodbye world :( [ cd0875583aabe89ee197ea133980a9085d08e497 : blob ] Hello world!