These are my steps to create a remote git repository and push to it the data that I have in my local machine:
# mkdir -p git/sports.git
# cd git/
# cd sports.git/
# git init --bare
Initialized empty Git repository in /home/tirengarfio/git/sports.git/
# exit
logout
Connection to 173.203.57.258 closed.
(master)]$ git remote add origin ssh://root@173.203.57.258/home/tirengarfio/git/sports.git
(master)]$ git push --all
root@173.203.57.258's password:
Counting objects: 1271, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (1236/1236), done.
Writing objects: 100% (1271/1271), 1.11 MiB, done.
Total 1271 (delta 37), reused 0 (delta 0)
To ssh://root@173.203.57.258/home/tirengarfio/git/sports.git
* [new branch] master -> master
When I go to /home/tirengarfio/git/sports.git/branches it is empty..
Hope this answers your question(s)…
Where are my files?
Git does not store the files in plain. It compresses them and stores then in a tree (and in so called packfiles). There is an article on gitready that explains the directory structure. For more details, you could refer to the manpage I linked below.
For details about the internal format, please see chapter 9 of the Pro Git book. Here is an online version:
Why is the branches directory empty?
The
branchesdirectory seems to exist only for legacy purposes. Which is documented inman 5 gitrepostory-layout:For more details, see: What is the .git/branches folder used for?
How do I get the files out of the
.gitdirectory?If you just want to access your files, the simplest way would be to clone your repository.