Git questions

I would like to set up a repo on my server using Git, but being new to it not quite sure how to go about it.

Do I need a github account? I have 1 but i need a private repo ann not quite sure why I have to pay if im hosting the files on my server. Rather confusing.

I want to host the files / branches on my server so why the need for a hub account?

I am using Aptana Studio 3 as my working environment. I have git installed on the server (Ubuntu 10.04 / nGinx) Google'd config / setup but to no avail as to actually create a repo for the project. Just basic install process which is where I sit so hoping maybe some answers here might point me in the right direction.

Thanks,

Dave

4 Replies

This tutorial might help you get started:

http://allanfeid.com/content/setting-yo … repository">http://allanfeid.com/content/setting-your-own-git-repository

Here's an alternate tutorial that also might be helpful:

http://tumblr.intranation.com/post/7662 … rver-linux">http://tumblr.intranation.com/post/766290565/how-set-up-your-own-private-git-server-linux

And no, you don't need to have a github account, since you're not using their repository servers.

For what it's worth, I've found gitolite to be a really good git server. It may be overkill for one person, but even for my personal stuff, I find it's nicer than the alternative.

What's the alternative?

mkdir ~/git
cd ~/git
git init --bare your-repository-here.git

Then, you can clone that (bare and initially empty) repository from anywhere else:

git clone your-username@your-server-hostname:git/your-repository-here.git

Keep in mind that every clone of the repository is an independent and fully-functional repository, which means the concept of "server" is somewhat arbitrary. This is much different than how SVN does things, for example. You can use git just fine without a server.

Thanks for the info guys,

Will give it an attempt and see how it goes.

Last question is where should the git repo be created on the server?

As of now its just me but would like to set it up correct so I do not have to do it again.

If you're using something like gitolite, you'll create a new 'git' user and gitolite will create the repositories there. Doesn't really matter too much where they end up, but if no other action is taken, they'll be under /home/git.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct