How does git-receive-pack work?

I would like to know how git-receive-pack works, because I have quite literally no idea what happens with it. Can anyone shed some light on this mystery?

How do I publish to

I’ve read the guide, which tells you to do the following:
create a repository
check it out to path/to/repo
cd /path/to/repo
git symbolic-ref HEAD refs/heads/gh-pages
rm .git/index
git …

Git contributors of each file

I want to list every contributors for each file in the repository.

Here is currently what I do:

find . | xargs -L 1 git blame -f | cut -d’ ‘ -f 2-4 | sort | uniq
This is very slow. Is there a …