Disclaimer: I\'ve been using Git for a while but still find it confusing.
I\'m setting a build process for a project and am running into a problem updating the git r
It is a best practice to push to a bare repo: see "concept of bare shared repository in git" and all about "bare" repos -- what, why, and how to fix a non-bare push.
Which means on your server, you need to:
git clone --bare yourProjectFolder yourProjectFolder.git
).git
extention is a naming convention for bare repo root folder)push to that bare repo instead:
Go to your local repo, and type:
git remote set-url origin /url/repo/repo/yourProjectFolder.git
add a hook in the bare repo (on the server, yourProjectFolder.git/hooks/post-receive
), in which you
yourProjectFolder
)unset GIT_DIR
git pull ../yourProjectFolder.git
See more at "Remote nodejs server deployment with forever".