Threaded
Threaded

Reputation: 71

Drupal Site with Existing Data, properly setting up Git Repo on server to push local code

I had some issues pushing updates via FTPloy, so I decided to set up Git on the client's dedicated host. Installation went beautifully. I created a --bare repo in the /public_html directory where the Drupal files are stored. I set up this repo as a remote, and attempted to push new updates to it. Unfortunately, this did not work. It appears as if everything was sent just fine, but this is not the case. I check the site, and no changes are apparent.

Could this be an issue with my configuration, or am I missing some steps in the process to set up a repo and have it recognize the local changes?

Upvotes: 0

Views: 149

Answers (1)

Thibaud Colas
Thibaud Colas

Reputation: 1266

Because of the --bare option, the repository you created just handles the history but no actual source code. Your pushes update this history, but the changes will never be reflected on the source files: git isn't even aware of them, it only uses the .git folder.

Bare repositories are used to share changes to the source code, see this article for more information.

To deploy your site with git, just delete the .git folder which was created and drop the --bare option when re-creating the repository. You may want to do a local backup first.

One last tip : this .git folder git uses internally should not be accessible from the Web, you might have to prevent this. Have a look at this question for solutions.

Upvotes: 2

Related Questions