Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Server Like GitHub? [closed]

Tags:

git

I am a long time Subversion user that is going to try Git. I have read some about it and understand the distributed nature - I can see a lot of the benefits.

However, I do like the idea of a central server that can take on the role of backups, system of record, etc, while still using Git for my local branching and sharing. I am not doing an open source project, so I can't use Github (without paying), so my question really is: what is a best practice way to run a local git server?

I realize this may be against the standard Git usage pattern, but it will be useful for my project. Any concerns that I may have overlooked are always welcome, however.

Thanks!

like image 575
skaz Avatar asked Mar 31 '11 23:03

skaz


People also ask

Why is GitHub closed source?

"GitHub isn't open-source, because they have a commercial offer based on it" seems to imply that you can't charge for open source software, but actually they could open source it and continue to have a commercial offering, if they wanted.


1 Answers

You can just set up an ssh server and run a central repository there. All developers then simply agree (as a matter of policy) to push to the server when they are done making commits. This is the usage pattern at my workplace. Very CVS and SVN-like.

  1. Find somewhere to put the repository (/var/gitroot for example).
  2. Create a new repo (mkdir project.git && cd project.git && git init --bare --shared=group).
  3. Then on your client, clone the remote repo (git clone ssh://yourserver.com/var/gitroot/project.git && cd project)
  4. add some files (git add README)
  5. commit (git commit -m "Initial import"),
  6. push (git push origin master)

This should set things up for you.

like image 149
Chris Eberle Avatar answered Oct 25 '22 21:10

Chris Eberle