I'm just starting to get down to the details of using git to co-operatively manage the contents of a web site remotely. I've managed all the basic set-up etc. such that I can connect to the site and get files etc. but I'm a little unclear about how things are supposed to go back to the remote/live site.
So, I have used 'git clone' to get the files from the remote system and I have done some changes to the files.
I then 'git commit -a' to commit my changes in my local repository, so far so good and it's what I'm (sort of) used to from previous experience of source code control.
However what do I do next to actually get the changes back to the remote site? Or, what does the 'manager' who controls the code, do to get my changes integrated into the code on the remote site?
Does 'git push' send my changes back to the site - it's not totally clear from the man page if this is what it does. The man page says "git-push - Update remote refs along with associated objects" which is a bit opaque. I *think* the following does copy the committed changes to the remote but I'd like to be sure:-
chris$ git push --all --dry-run To chrisgreen@donttravelempty.com:/var/www/vhosts/donttravelempty.co.uk/subdomains/test/httpdocs 0474601..d6eb8a0 master -> master
On 25 Nov 12:16, Chris G wrote:
I'm just starting to get down to the details of using git to co-operatively manage the contents of a web site remotely. I've managed all the basic set-up etc. such that I can connect to the site and get files etc. but I'm a little unclear about how things are supposed to go back to the remote/live site.
So, I have used 'git clone' to get the files from the remote system and I have done some changes to the files.
I then 'git commit -a' to commit my changes in my local repository, so far so good and it's what I'm (sort of) used to from previous experience of source code control.
However what do I do next to actually get the changes back to the remote site? Or, what does the 'manager' who controls the code, do to get my changes integrated into the code on the remote site?
Does 'git push' send my changes back to the site - it's not totally clear from the man page if this is what it does. The man page says "git-push - Update remote refs along with associated objects" which is a bit opaque. I *think* the following does copy the committed changes to the remote but I'd like to be sure:-
chris$ git push --all --dry-run To chrisgreen@donttravelempty.com:/var/www/vhosts/donttravelempty.co.uk/subdomains/test/httpdocs 0474601..d6eb8a0 master -> master
The push would, indeed, push the files to the remotes .git directory.
Unless there's a post-commit hook that automatically then checks out the latest master/updates the checkout, it won't automagically propogate them to live though.
As a general rule of thumb, the person that set up git should tell you how you're supposed to interact with it, especially in the case of live websites.
If you're suppose to push, and then jump on the server and rebase, they should have told you that.
Cheers,
On Thu, Nov 25, 2010 at 12:44:22PM +0000, Brett Parker wrote:
On 25 Nov 12:16, Chris G wrote:
I'm just starting to get down to the details of using git to co-operatively manage the contents of a web site remotely. I've managed all the basic set-up etc. such that I can connect to the site and get files etc. but I'm a little unclear about how things are supposed to go back to the remote/live site.
So, I have used 'git clone' to get the files from the remote system and I have done some changes to the files.
I then 'git commit -a' to commit my changes in my local repository, so far so good and it's what I'm (sort of) used to from previous experience of source code control.
However what do I do next to actually get the changes back to the remote site? Or, what does the 'manager' who controls the code, do to get my changes integrated into the code on the remote site?
Does 'git push' send my changes back to the site - it's not totally clear from the man page if this is what it does. The man page says "git-push - Update remote refs along with associated objects" which is a bit opaque. I *think* the following does copy the committed changes to the remote but I'd like to be sure:-
chris$ git push --all --dry-run To chrisgreen@donttravelempty.com:/var/www/vhosts/donttravelempty.co.uk/subdomains/test/httpdocs 0474601..d6eb8a0 master -> master
The push would, indeed, push the files to the remotes .git directory.
Unless there's a post-commit hook that automatically then checks out the latest master/updates the checkout, it won't automagically propogate them to live though.
Ah, OK, so a further action is required to make them 'live'.
As a general rule of thumb, the person that set up git should tell you how you're supposed to interact with it, especially in the case of live websites.
If you're suppose to push, and then jump on the server and rebase, they should have told you that.
The "the person that set up git" is probably not much more familiar with it than I am. :-)
Thanks though, that clarification about what 'get push' will do is just what I wanted to know. We (I and "the person that set up git") will now have to decide who manages the live site files.