views:

316

answers:

5

Hi, I currently use svn at work.

Our setup is: everyone has a working copy and we commit to a svn server served by apache2.

So I commit changed, the other update, and everyone can work on the copy as they wish.

So it's pretty easy to deploy.

But now, I'd like to do the same thing but with Git. Would it be possible?

I'd like to have a git repo on my main server, develop at home, commit changes to the server, etc.

Thanks for your help

+1  A: 

Yes it's possible.

on the server where your stuff is located
  git init
  git add .

on your local
  git clone git://yourserver/repo localfolder

to get changes
  git pull
  git fetch
to send changes to server
  git push

Here are links how to setup your server

egon
git://yourserver/repo localfolderBut this path, will be served by a normal apache directory listing?
Tom
see http://www.kernel.org/pub/software/scm/git/docs/user-manual.html#sharing-development
egon
Thanks for your answer, but I still don't get it lol.But I found that in the doc you sent me:$ git clone ssh://yourhost/~you/repositorySo that should do the trick.
Tom
You should create a bare repository on the server.
innaM
+4  A: 

Git - SVN Crash Course

Especially this is of interest for a starter

git init
git add
git clone git://...
git pull
git fetch
git push

Then check the rest of the documentation on the git site

Git documentation

jitter
+1  A: 

Absolutely - you can set up central (bare) GIT repositories that can be used as a central point. Or use something like GitHub.

With GIT it's more a matter of getting your process set up to use it as you wish.

Paddy
+2  A: 

Just set up a centralised repo that everyone pushes to and pulls from.

Just because git has no concept of a central or preferred repo, that doesn't mean you can't designate one to be so by convention among your team.

Abizern
+1  A: 

One thing to add to the other answers:

While a centralized workflow (with one "central" Git repository) is off course possible, you need to keep in mind Git organizes its data differently (as a all, looking into the data content to infer various property, like file rename). See this answer for more differences between Svn and Git.

One consequence is that you should not necessarily consider having just one Git central repository, but several, especially if you have many group of files with different and independent history (they evolve each at their own pace).

SVN can store all those different group in one repository and can branch or tag whatever part it wants (it is just a matter of copying what you need in a "directory" representing a branch or a tag). Git branch and tag at the repository level.

If your set of files is quite coherent, you can have one Git central repo, but if you have several components, may be several "central" Git repos are better.

VonC