0

I'm new to git , basically from Perforce background. Our team is planning to move to GIT.

Would like to know how to create a GIT Central server from where we can do checkout , commit and other operations similar to Perforce Central server(Its on CentOS).

Thanks for the help !

baba yaga
  • 119
  • 2
  • 10
  • 1
    Install [GitLab](http://about.gitlab.com) and be done with it. – Jonathon Reinhart Jul 26 '15 at 15:20
  • Note to close voters: the question isn't about resource recommendations, so voting to close on that basis seems incorrect. – Caleb Jul 26 '15 at 16:22
  • See [gitosis vs gitolite?](http://stackoverflow.com/q/10888300/643383) – Caleb Jul 26 '15 at 16:28
  • @Caleb fwiw I disagree. I read the question as "how do I use git as a server"/"what is equivalent to perforce central server for git" - the former showing no research, the latter definitely being a request for recommendations since there are multiple possibilities. – AD7six Jul 26 '15 at 16:33
  • 1
    @AD7six Question is "how to create a GIT Central server." There are certainly products out there that can help here, but OP hasn't asked for them specifically. There are two good answers here covering how to proceed without additional products, so it's not a question that's hard to answer, and it doesn't need to be closed as a resource request. It's very probably a duplicate, though. – Caleb Jul 26 '15 at 16:56
  • [Perforce has its own Git Collaboration tools](http://www.perforce.com/git) which may prove useful to you. I've updated my answer with this information. – Schwern Jul 27 '15 at 23:13

2 Answers2

1

What you need to do on the central server is to create a bare repository, and simply clone it from any other machine.

mkdir my_repository.git
cd my_repository.git
git --bare init

Then set SSH access to this server, regardless to the git, by either username/password access, or by adding the public keys of the users.

Clone the repository from any machine:

git clone ssh://user@machine:/.../my_repository.git

Since this repository is bare it does not a have a working directory. All it means that you need to push your changes to it, and you cannot work from the server itself.

Igal S.
  • 13,146
  • 5
  • 30
  • 48
  • Thank you for the suggestion @Igal S. Few queries to be clarified : 1. in our case , the source code has been shared in a ftp site as a zip file for every release. we have like ~15 zips to be imported to our git server, how can I achieve this ? also, does repository has to end with ".git", as you mentioned above (might sound lame )? – baba yaga Jul 28 '15 at 14:29
  • The repository name has no meaning `.git` is just a convention. If you want to import older releases, you need to do it manually. Unzip and commit each release one by one. So you will end up with 15 commits of 15 releases. – Igal S. Jul 28 '15 at 14:47
  • S : I'm fine with setting up ssh access to the server.. Is it possible to have SSH, HTTPS & Git access configured to the same server, if so how can I achieve that ? Thanks! – baba yaga Jul 29 '15 at 12:55
1

Git is a distributed version control system, how it interacts with "servers" is very different from Perforce (a centralized version control system). You don't checkout nor commit to a server, that is all local. A central server (ie. a "remote") can be used to coordinate everyone's copies of the repository using "push" and "pull".

This takes some time to get used to, but it's worth it.

While you can run your own centralized Git remote, some of the advantages of Git will be more difficult to take advantage of, and new users will find it harder to understand what is going on.

I would recommend using something like Gitlab which will provide many of the features of Github including an integrated issue tracker, commit tracking, pull requests, and other features fundamental to a well run project using Git.

Another option, which may be more familiar to you, is to use Perforce's own Git Collaboration tools. (Note: I know nothing about these, I just know they exist).

Schwern
  • 153,029
  • 25
  • 195
  • 336