Tushar
Tushar

Reputation: 1176

Git push does not update files on server

I am new to using git, I have done the following as part of the setup. I have a dev server on which we have the php code up and running. I converted the directory into git by git init. I have the same code copy on my local. which I used to transfer to dev via 'File transfer'.

Now since I converted my dev into a git ,I did same for local and added the dev git url as remote for the local and did a hard reset to match local as dev.

I changed a file and did git push, during that it gave me error refusing to update checked out branch: refs/heads/master for which I followed an answer on stackoverflow and converted dev repo into bare repository

git config --bool core.bare true

Now git push works , but the exact same file is not getting updated on dev server. What I might be missing?

Upvotes: 0

Views: 705

Answers (2)

eftshift0
eftshift0

Reputation: 30212

I am working on a project to present the contents of a branch/revision/tag of a repo on a virtual FS. It's based on fuse and libgit2. It's in the very early stages at the moment but it can show you the files/directories in a revision and their contents. If you ask to use a branch, if the branch is moved, it will refresh the virtual FS on the fly. Just in case: early stages so no LFS, no submodules, no... whatever fancy feature you are thinking of? None of that. Just trees and blobs in git jargon.

https://github.com/eantoranz/gitmod

Upvotes: 0

wRAR
wRAR

Reputation: 25693

You cannot update the remote working copy with git push anyway, and when you converted the remote repo to bare it doesn't have a working copy at all. One of usual practices is to push to a separate "master" repo and pull from it on each machine you need the working copy (including your dev server).

Upvotes: 2

Related Questions