简体   繁体   中英

In a local repo where does git save the files?

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

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 .

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM