This is not a question about the hidden .git
folder!!
My Understanding
I typically use GitHub for most of my Git work. When working with the remote server, I might have my push and fetch configured as such:
$git remote -v
origin git@github.com:<my_org>/<my_repo>.git (fetch)
origin git@github.com:<my_org>/<my_repo>.git (push)
The question here is specifically about that <my_org>/<my_repo>.git
file.
I know that it "contains" all of the machinery required for a repository: the files, the index, hooks, references, etc. I have been "imagining" that it is a hierarchical zip file that is essentially just the entire repository as it would look locally if I were to zip it all up.
My Questions
- Is my understanding correct? Is the
<blah>.git
file just a zip of the repository? How do I generate it? - What does git do in order to construct / deconstruct it, each time I either
git init
andgit push
or each time Igit clone
? (Is this really just a zipping and unzipping?) - Is there any way to create this structure myself? E.g., is this how GitHub does it on their end (more or less)?
- And can I use that same
git init -g
command or something similar to create a.git
file.
- And can I use that same
- Where is the documentation on this
<blah>.git
file (beyond the link above)?- I did search for a little while, but everything on
".git"
turns up the hidden directory, not the file.
- I did search for a little while, but everything on
- If I create this
<blah>.git
file on my machine, can others then use my machine as a remote repository?- Put another way, how would I create a machine and a file/folder structure to act like a remote repository for someone else?