0

I'm using a local git repo, with the main repo folder stored in a network path

I can push the changes without problems and I can see the files in my repo, but when I access the main folder I don't see any files that I've pushed

The files aren't store in the main repo? Just locally?

EDIT: there is no .git folder in my main repo, that's why I'm questioning where the files are

Tgo1014
  • 536
  • 1
  • 7
  • 17
  • 1
    Possible duplicate of [Where does Git store files?](http://stackoverflow.com/questions/3082445/where-does-git-store-files) – bahrep Jul 19 '16 at 12:43
  • It will create a folder `.git`. – Shravan40 Jul 19 '16 at 12:52
  • 1
    This question is too vague for a precise answer. You should provide the commands you ran and explain why what you saw is different from what you expected to see. Then people won't have to guess where your misunderstanding is – trent Jul 19 '16 at 12:57
  • @Shravan40 there is no .git folder – Tgo1014 Jul 19 '16 at 13:12
  • It's a hidden folder. If you are on Linux machine ` cd project_directory && ls -a`. – Shravan40 Jul 19 '16 at 13:13
  • I'm on Windows with show hidden folder option on. Maybe is something related to the repo being bare? – Tgo1014 Jul 19 '16 at 13:15
  • The contents of `.git` of a non-bare repository are directly stored inside a bare repository, so for `.git/HEAD` you have just `HEAD` in the bare repository. – C-Otto Jul 19 '16 at 13:34

2 Answers2

2

Git stores repository data in hidden .git directory at the root of the repository. In case of a barebone repository, git repository contains only contents of .git dir without any working directory.

Read the documentation: Git Internals - Plumbing and Porcelain.

bahrep
  • 29,961
  • 12
  • 103
  • 150
1

I think what you call "main repo" is the git remote that you push to. In this case I guess this remote is configured "bare", meaning that only the git-internal files are stored. What you are missing is the checked out version of each file. This is something a typical git server does not need, as there is no human directly working on those files, or any other program (besides git) using them.

To clarify, the internal files are normally stored in the .git directory. This storage also contains all previous versions (or the differences between the versions). Based on this, you also see your regular files. A bare repository only has the internal files.

C-Otto
  • 5,615
  • 3
  • 29
  • 62
  • You're right, my repo is configured as bare and there is no .git folder. That means that no files are stored in the folder? Just the internal files? – Tgo1014 Jul 19 '16 at 13:10
  • 1
    The internal files are part of any repository, bare or not bare. These files contain the actual data (possibly in a strange format), and consume as much disk space as necessary. The "real" files (for example `.java` files you open with your IDE) simply are not there for bare repositories. – C-Otto Jul 19 '16 at 13:13