Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

github

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.

like image 525
Panagiotis Panagi Avatar asked Dec 30 '25 18:12

Panagiotis Panagi


2 Answers

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.

like image 184
Boldewyn Avatar answered Jan 02 '26 10:01

Boldewyn


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.

like image 38
Patrick B. Avatar answered Jan 02 '26 09:01

Patrick B.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!