Answer the question
In order to leave comments, you need to log in
How to raise a full-fledged git server?
What you need:
A shared git server that would apply changes immediately upon pull.
What is:
VPS hosting, git, ssh.
What's the problem:
There was a regular site in www/, I did git init, add ., commit for it. I made a clone on my local, everything was cloned. Now I need to push the changes from my repository back to production (vps). Pull refuses to do, citing that a bare repository is needed. But how can it be bare if it's production? As far as I know, these repositories themselves do not store files, but only changes to .git
Answer the question
In order to leave comments, you need to log in
In general, I did this: bare repository + capistrano. It turned out very well.
You can't push to a checked out branch. That's why bare is needed.
And in a good way, it would be necessary to export the code, and not force the web server to work from the repository. It is done with a simple hook on the server side.
Pull refuses to do, referring to the need for a bare repository
Show what exactly it writes
How was the clone made?
If everything is correct, then git push origin from local should be enough.
git config --bool core.bare true? in the directory where you have www on vps
If I understand correctly, then you need to upload the changes to the server and then apply them on the server. But then it turns out that you need 2 repositories on the server: the one where the push will be sent from the local computer and the one that will pull from the remote (because the server will not be able to pull from the local).
The second rep is easiest to do in the home folder, and pull is easiest to set up by cron, say, every day (or half a day).
Did git config receive.denyCurrentBranch ignore on remote. Now push, but immediately marked as deleted judging by git status
To "raise it on your own" - you can either just work via ssh, or use gitolite, where authentication takes place using ssh keys.
I work through bare=false, denyCurrentBranch=ignore
besides this, only .git/hooks/post-receive:
#!/bin/sh
cd…
GIT_DIR='.git'
umask 002 && git reset --hard
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question