I’m using git to manage a grails project I have. I set up a git repository on a remote server and what I want to do is when I have code working locally, I want to commit it and push to the remote server. I want the updated groovy file and gsp’s to be put into the right spot on the remote server so that grails will pick up the changes for remote testing. Is this possible?
Share
If you are pushing to a remote repo, where “it only seems to contain a large pack file, no actual source code” (as you detail in the comments), that should mean “bare repo“, which is good for it allows you to push without any risk of differences between a working tree and the git data.
Then, as described in “Can I use git to keep a remote server up to date?“, another (non-bare) repo and a
post-update hookon the bare repo side will get you where you want.The OP TripWired adds:
~/project.gitand~/project.I cloned
project.gitintoprojectand inproject.git/hooks/post-updateI put:cd ../../project
env -i git checkout .
env -i git pull
I agree with steps 1 and 2, but would then use this script, as in this question.
Check if it works with a
git pushfrom your local repo to your bare repo.