views:

45

answers:

1

I upload PHP website project to server godaddy. And I use Netbeans and once I code on project at localhost, it'll execute remote synchronization with project on server when I save file.

Now I want use Git, I read many guide, almost use GitHub. But I don't want to use GitHub. And here :

http://progit.org/book/ch2-9.html

To be able to collaborate on any Git project, you need to know how to manage your remote repositories.
Remote repositories are versions of your project that are hosted on the Internet or network somewhere

or

Pushing to a Remote Server

  • is Remote repositories is project on godaddy server ?
  • And a more question:
    I only has 2 project code :
    • 1 on godaddy server,
    • 2 on localhost.
      Master branch is project code on my localhost in this case ?

I read many guide but almost don't understand.

+4  A: 

"Remote Repositories" is any git repo on a remote server where Git is installed.
GitHub is an example of "remote repos" server.

Should you want to deploy your PHP site directly through Git on your remote server (here a GoDaddy server), you need to make sure:

  • Git is installed there
  • you have a bare repo copied there
  • you have the right hooks to deploy your website on each git push

See "Deploy PHP using Git" or "Git and PHP Deployment Tools?"


master is the branch usually checked out by default when cloning, but this is not always the case.
It is however a good practice to reserve the master branch for "what is running in production".

VonC
thanks much for answer
meotimdihia
@VonC, why the "good practice ... running in production"? Convention or there is a technical reason?
Thorbjørn Ravn Andersen
@Thorbjørn: pure convention, but `master` is also *usually* the branch you get by default when cloning your bare repo from the prod remote workstation, so if you need to make a patch in an hurry, you can start right away.
VonC