Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Git with a website [duplicate]

I am developing a website which so far has been pretty simple, and my methodology is probably not considered professional but I have not had any problems doing it this way:

  1. write script on home PC
  2. FTP to the server location
  3. load website in browser and check if page works as I hoped.
  4. repeat

Now, somebody else is going to help me, so I want to add some version control, as the "easy" part of the website is done and we will be doing more interesting stuff. For better or worse I've chosen Git as the DVCS. I have git already on the server, bt am not sure where to init a git repository on the server.

What I mean is, should I initialize the git repository at the base directory of my website? If so, assuming various open exist, will this be a problem?

I've used git with other projects, but not for websites, except doing some tutorials with RedHat Openshift.


1 Answers

Here's a possible workflow:

  1. Initialize a Git repository on your computer in the base folder
  2. Create a develop branch. This is where all the development will happen
  3. Have your collaborators clone your repository
  4. Anytime you commit, do it on develop branch. Anytime your collaborators commit, have them commit on their develop and then push to you
  5. Once you're ready to deploy to actual web server, switch to master branch and merge develop into it
  6. rsync/ftp to the server
like image 127
enthrops Avatar answered Dec 17 '25 09:12

enthrops



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!