Using git as a centralized version server

后端 未结 5 1172
悲哀的现实
悲哀的现实 2021-02-04 17:21

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, an

相关标签:
5条回答
  • 2021-02-04 18:11

    Yes it's possible.

    On the server where your stuff is located:

      git init
      git add .
    

    On your local computer:

      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

    • ssh
    • http
    • daemon
    0 讨论(0)
  • 2021-02-04 18:11

    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.

    0 讨论(0)
  • 2021-02-04 18:16

    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.

    0 讨论(0)
  • 2021-02-04 18:20

    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

    0 讨论(0)
  • 2021-02-04 18:22

    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.

    0 讨论(0)
提交回复
热议问题