Git unable to clone from "remote" to working dir on that server?
I've been using SVN at work, but we've never been able to fully take cleanly integrate branching & merging as I'd like so with that, and the desire to allow remote developers to have a fully distributed VCS I thought I'd take a look at git.
I setup git and gitolite on a CentOS 6.3 server that we'll call nix2 and added a single repository with some content. On my local workstation (Macbook Pro OSX 10.8) I was able to git clone git@nix2.domain.com:admin.domain.com which I understand is the same as a svn checkout. I then added a files, committed and did a git push Code:
MacBook-Pro:admin.domain.com jukas$ git push Code:
[root@nix2 htdocs]# git clone git@nix2.domain.com:admin.domain.com Code:
MacBook-Pro:sites jukas$ git clone git@nix2.domain.com:admin.domain.com I've tried doing the git clone on the server itself as the following users root, git, jukas all with the same results. When I check /var/log/secure it just shows a ssh connection opening and closing. I thought maybe this was a RTFM situation, but in reading the process seems pretty straightforward so I'm stumped what I'm doing wrong. Any insight is much appreciated. |
I'm not sure to understand the question completely :) but
maybe git uses a different syntax on OSX. The syntaxt I'd use on Linux would be Code:
git clone git@nix2.domain.com admin.domain.com |
Quote:
I have a CentOS server called nix2.domain.com. On that server in /www/htdocs/admin.domain.com I have existing content I wanted to manage via git (I'm used to SVN) but also access on my macbook as well as let a handfull of other developers have access to. Because the code is commercial and devs have to sign a NDA, I can't use a public github repo and would rather host my own git remote server than pay a monthly fee. Normally I would setup SVN on nix2.domain.com add the repos and then check out the code on the desired machines. So on nix2 I added a user called git and created /home/git/repos/admin.domain.com and did a git init --bare. I then tried to clone /www/htdocs/admin.domain.com to git@nix2.domain.com:/home/git/repos/admin.domain.com and was told it didn't appear to be a git repo. This is the same issue I experience prior when I tried to use gitolite to create and manage repos. Here's how I was able to workaround and fix it, but surely I should be able to add existing content to a repo, and then clone it to the 'master repo' that the remote server is hosting? As user git I created /home/git/repos/admin.domain.com and did a git init --bare. Then on my laptop I did a git clone git@nix2.domain.com:./repos/admin.domain.com and checked out an empty repo. Next I fired up my ftp client and downloaded the content from nix2 /www/htdocs/admin.domain.com into the workingdir I just cloned. Then I did a git add . followed by a git commit and a git push origin master. Then I went to /www/htdocs/ and tarballed admin.domain.com and deleted it before doing a git clone git@nix2.domain.com:./repos/admin.domain.com . Once I found that workaround I was able to properly clone it both in the /www/htdocs dir and in a working dir on my macbook and push / pull between the two, however this is rather cumbersome as some of the sites I need to manage via VCS are rather large with many nested subdirs which makes ftp'ing content down to my laptop a pain in the butt. Surely there's an easier way to accomplish this? As an aside question, if I plan on managing less than 20 repos is there a compelling reason to use something like gitolite or gitosis? |
Well I'm not very deep into the git stuff. I have some local repos in our local net which are public as they are not reachable from the outside and I use cgit as a webinterface for that.
So maybe I can't help you much, but I remember I had once always empty repos when I tried to clone them. Actually this was a stupid file and folder rigths thing. The git-deamon is running as user git and when I used git init even as userX it creates an empty repo owned by user "git". But when I added files, they were owned by "userx" and git add + git commit didn't touch them as user "git" had no rigths ... So actually I have to do Code:
su git Maybe it helps ... |
All times are GMT -5. The time now is 03:26 AM. |