7
You can create a Git local server?
I would not like to be dependent on the internet.
7
You can create a Git local server?
I would not like to be dependent on the internet.
10
There is! There is a chapter in the Git Pro book that covers this. The book is available online.
I recommend reading because there are several options. You may, for example, need authentication for read access or may require more server speed. For each of these choices, there is a recommended protocol. Github, for example, provides read access to public repositories via git protocol (lighter and faster). But for writing access from project commiters, it uses SSH (a bit heavier, but provides authentication). Another option is HTTP for reading, which makes it easy to traverse corporate firewalls.
Anyway, there are basically four options:
What you’ll choose (or whether you’ll choose a hybrid solution like Github) depends on your needs. So I recommend reading the book.
3
To start a GIT repository anywhere, just type in:
git init
If the folder where this repository is is accessible local, usb, or network, it passes you will be able to push it to your other repository as remote.
For example, I have in my project folder and in my USB the same repository:
/home/gartz/projects/foo
$ git init
And also on my USB:
/media/usb_gartz/foo
$ git init
Now just register usb as remote in my personal project and it will be my GIT server /home/gartz/projects/foo
$ git remote add origin /media/usb_gartz/foo
Now whenever I give a push or fetch it will fetch on origin that in the case is the /media/usb_gartz/foo
and is local.
You can add access via any protocol, SSH, SMB, FTP, etc if you want to give remote access to your server.
But if you don’t want a snapshot of your project on your local server, you can use Bare Repository which is nothing more than the folder .git
which is created, you can copy it and point to it, just like in the example.
2
Adding to what Gabriel Gartz said: Git doesn’t have a centralized server. Git, like Mercurial for example, is a noncentralized repository. You don’t create a Git server, but a master repository - which can be any git repository on your network.
To do this, simply choose which machine on your network will be the "Canonical"/"master" repository, configure your IP/name correctly, and configure the other machines to push to it (i.e., it would be Master) as you would with Bitbucket/Github. Versioning processes will not change.
1
On your server you create the git directory by doing:
git init --bare
On the station where you will work you boot only with
git init
Well see more in an article I wrote in 2011 although old codes remain the same: http://oraculum.blog.br/blogoraculum/index.php/git-comandos-basicos/
0
Unlike solutions like cvs and svn, Git is decentralized. You don’t need to have a fixed server. You can simply share a folder on the network and do push
there. You can also put an ssh server on your internal network.
Browser other questions tagged git
You are not signed in. Login or sign up in order to post.
Even if this link is a good suggestion, this reply will not be valid if one day the link ceases to work. So, because it’s important for the community to have content here, you’d better respond with more complete answers. You can elaborate more your answer?
– Maniero
elaborate! recalling that the local mapping solution (which seems to be what the other answers are suggesting so far) is not always applicable to all situations.
– Thiago Arrais