Horacio Garza
Horacio Garza

Reputation: 135

Why does Git doesn't update in my server's folder?

I made a git repo in my server's folder with a path \\xxxxxx\Demo, then I made a git clone and everything is ok, but when I make the commit and push it to the remote (the server's folder) it says that it was succesufully

$ git push origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 212 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To //xxxxxx//Demo
 * [new branch]      master -> master

But when I check the file in the server isn't updated so I've proceed to check the log with git log and it shows me the commit that I've pushed but there are no changes.

Am I doing something wrong?

Upvotes: 1

Views: 396

Answers (2)

lubilis
lubilis

Reputation: 4160

You've configured a bare repository on server side. You can't run git pull without a working tree, but you could only run git fetch.

Bare repositories are intended to track all VCS changes but you can't use them as a git working copy with resources. You could try to create another repository on server side (not bare) and pull resources from bare repository.

Upvotes: 1

Grzegorz Żur
Grzegorz Żur

Reputation: 49181

In order to update files on the server you need to run git pull on the server. Pushing changes just the state of files in .git folder.

It is very common to use bare git repository on the server.

Getting Git on Server

Upvotes: 1

Related Questions