GIT on apache server with shared directory.

BaTouSai

Well-Known Member
Joined
Apr 14, 2010
Messages
402
Hi all,

I need some advice please.

I use git and github for my pet projects and I have now suggested that we start using git at work. Currently we all work from one shared directory on a linux server. My idea is that this shared directory becomes the master and then another directory for the clone. Then you clone the folder that you want to work on to that directory and you can change and commit in that directory and when you are finished push to the master with a commit message etc.

Will this work? Is there a better way? Currently we have no version control so anything is better than nothing.

Thanks in advance.
 

Hamster

Resident Rodent
Joined
Aug 22, 2006
Messages
42,920
Get a proper git server running. Easiest is a self hosted one.

Butbucket Server - you'll need to.pay but very powerful. Can also make use of butbucket.org (5 free users I think) or GitHub itself if you want it offsite.

Gogs.io is a free one. Works fairly well but basic. Personally, this is the one I'd start with. Very quick to get up and running.

There's also gitlab if you really hate yourself and want to set it up through a web server.
 

rward

Senior Member
Joined
Oct 26, 2007
Messages
865
Can also make use of butbucket.org (5 free users I think) or GitHub itself if you want it offsite.

You said "but"...


Bitbucket is great, confirm the 5 free users and unlimited private projects.

Read up about workflow in git. Pull requests will be your friend and allow for peer review (a positive).
 

Waansin

Well-Known Member
Joined
Feb 16, 2005
Messages
284
I use git and github for my pet projects and I have now suggested that we start using git at work. Currently we all work from one shared directory on a linux server. My idea is that this shared directory becomes the master and then another directory for the clone. Then you clone the folder that you want to work on to that directory and you can change and commit in that directory and when you are finished push to the master with a commit message etc.

Will this work? Is there a better way? Currently we have no version control so anything is better than nothing.

The way you described cloning and branching - in terms of copying folders - sounds very wrong. I hope it is just that you don't know the Git terminology. As for your office, there is no excuse for not using a source control system there, so fight to get something entrenched. Even if that means it is only you using it in the beginning.

To get started, you should read the Git Book https://git-scm.com/book/en/v2.

If you have to keep the code on one of the company's machines, then I would use gogs.io as already suggested.
 

scudsucker

Executive Member
Joined
Oct 16, 2006
Messages
9,024
While you are rolling out source control, I strongly suggest you roll out an automation server.

The automation server is the thing that deploys the master branch to your server (not humans).

The humans work in branches (I like the Git Flow method, but there are many strategies) and when a human checks in the master branch the automation server (ideally, again) runs unit tests and deploys the master branch to your server.

There are too many advantages of this system to list, but the most important ones are

1) You will never overwrite anyone's code by mistake, and
2) If a change gets deployed and is found to have a bug, you can use the automation server's history to immediately roll back to the previous version

Jenkins is a commonly used automation server. It has a poor GUI and bad usability but it is free and once you are familiar with it, quite powerful, with many plugins.

https://jenkins.io
 
Top