0

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://[email protected]/home/tirengarfio/git/sports.git (master)]$ git push --all [email protected]'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://[email protected]/home/tirengarfio/git/sports.git * [new branch] master -> master 

When I go to /home/tirengarfio/git/sports.git/branches it is empty..

2
  • 2
    And what exactly is your question? Commented Jun 23, 2012 at 17:04
  • @iblue my question is: where are the files that i pushed? I expected they were inside the folder branches or any other part inside sports.git folder.. Commented Jun 23, 2012 at 17:14

1 Answer 1

3

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 branches directory seems to exist only for legacy purposes. Which is documented in man 5 gitrepostory-layout:

branches

A slightly deprecated way to store shorthands to be used to specify URL to git fetch, git pull and git push commands is to store a file in branches/ and give name to these commands in place of repository argument.

For more details, see: What is the .git/branches folder used for?

How do I get the files out of the .git directory?

If you just want to access your files, the simplest way would be to clone your repository.

$ git clone /home/tirengarfio/git/sports.git/ 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.