문제

My team have 3 or 5 person.And we are working locally.

and we decided to choose git server on my laptop so other person can check out...

I have tried something like this:

mkdir gitexample
cd gitexample
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin git@IP_ADDRESS_OF_SERVER:example.git
git push origin master

But when I run until the :

git remote add origin git@192.168.1.15:example.git
git push origin master

I got the message :

git@192.168.1.12's password: 
fatal: 'example.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

Anybody know how to install and config it on fedora? 192.168.1.15 is my ip address.

and When I run:

[root@localhost .ssh]# ssh git@192.168.1.12
git@192.168.1.12's password: 
fatal: Interactive git shell is not enabled.
hint: ~/git-shell-commands should exist and have read and execute access.
Connection to 192.168.1.12 closed.

Anything else to make it work?

도움이 되었습니까?

해결책

On the server you have to init a bare repository.

mkdir example.git
cd example.git
git init --bare

After that you'll be able to clone/pull/push from and to the repository.

다른 팁

What you are looking for is gitolite, which is a Git server. Fedora requires no particular procedure here as opposed to any other Linux distribution.

In essence, gitolite manages your repositories by using SSH access. You create a specific user (namely, git) to access the repositories, then provide a simple configuration file with user privileges for authorization. You manage authentication by public SSH keys. Creation of repositories and changes of authorization can be performed via a special "administration" repository, while destruction of repositories must be performed manually.

All in all, it is a pretty low-level facility for handling Git repositories. It starts simple but it has a lot of configuration details you can tune. The quick install documentation is pretty straightforward.

In my opinion, gitolite is a good investment also for "local" workgroups. When you have gained confidence with the (very simple) setup procedure, managing repositories becomes a piece of cake.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top