Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm setting up a new project, and I am getting into doing local development, then I want to upload all the changes to the master server. Basically, I'm wondering, do I need to install git on my local machine, and the master server, and then use something like BitBucket to host the code? So I can pull and push from the BitBucket to my LOCAL machine, and then on my production server, I can pull the code after all the changes are committed? Is this the best way of doing this?

Or, should I make it so I pull from the production server, and push directly to the production server? Whats the best way to do this stuff?

Thanks

share|improve this question
    
This is a very broad question with no one right answer. What are you specifically looking for in your version control? If you can narrow down the context of this question someone might be able to help you. –  Nic Young Jun 29 '12 at 16:55
    
Also, try github. Has more features. –  sensorario Jun 29 '12 at 17:07
add comment

1 Answer

Since git is a distributed system, any of those options are valid.

What I usually do is have git on my workstation, on a "server" somewhere with a bare repo

git init --bare

I push from my workstation to the bare repo on a server. Then other people pull from the server repo also and we can merge from there. You could also push it to github or bitbucket or whatever and use that in place or in addition to the "server repo" I have stated.

I usually use the code to build a package (rpm or deb) to have version control and deployment done that way but you could additionally push directly to a repo somewhere with a post hook to do updates that way.

share|improve this answer
    
Well, this is for a PHP project I'm going to be working on. I have the local development server, as well as friends do for this project. So we need somewhere we can push all our code to, to merge it and get a release ready for the next update to the site. Then once all this is done, we need to be able to go to the production environment and get all the code to make live to everyone. –  David Jun 29 '12 at 17:05
    
I'd sign up for bitbucket or github and then just push there for your friends to pull from. –  Michael Beattie Jun 30 '12 at 1:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.