Panagiotis Panagi
Panagiotis Panagi

Reputation: 10077

First "git push" to remote repository. Can't find where it places the files of the project

I'm new to git and for the last couple of hours I 've been trying to setup a remote repository of a local project.

So I followed the instructions:

# on the remote server
cd path/to/myapp.git
git --bare init

then:

# on local machine
git remote add <name> root@<ip>:path/to/myapp.git
git push <name> master

It successfully pushes the project:

Writing objects: 100% (729/729), 14.68 MiB | 56 KiB/s, done.

However I can't find where it places the project files. I have looked everywhere: path/to/myapp.git subfolders, parent folders, even used the find command to search the whole disk.

What am I doing wrong?


UPDATE: So basically I took the wrong path. On remote machine I should

git clone <local_repository_url>

to get an exact copy of the local project

and then on the local machine

git push <name>

to push changes.

Upvotes: 3

Views: 3846

Answers (3)

Boldewyn
Boldewyn

Reputation: 82734

You're doing everything perfectly fine (presumably). A bare repository is one without any working copy, so all content is stored in a git-internal way. Look at /path/to/myapp.git/objects/. In this folder there are lots of files, that correspond to Git objects.

To see, what any of these objects really contains, you can use

git show <OBJECT-ID>

For details I recommend this chapter in the Git Book.

Upvotes: 3

VonC
VonC

Reputation: 1324347

A bare repo won't display any file, since it won't checkout said file in a working tree.

See "What is a bare repo":

A "bare" repo, as the git glossary says, is a repository that does not contain a "working tree" at all.
It doesn't contain the special .git sub-directory either; instead, it contains all the contents of the .git subdirectory right in the main directory itself.

Upvotes: 1

Patrick B.
Patrick B.

Reputation: 12353

GIT is storing changesets in its object-data-base (compressed). You cannot find your files simply like that with find.

See the objects/-folder in the .git-folder or in the bare-repository.

Upvotes: 1

Related Questions