Unable to git clone from one folder to another in windows - windows

I have a created a bare repository in C drive and I'm trying to clone the same in D drive by issuing the below command (in windows machine)
git clone Username#Ip_address_of_my_machine:C:/path_to_the_git_repo
but I'm unable clone it as it comes up with the error
"Cloning into 'git_repos'...
ssh: connect to host 192.168.0.5 port 22: Connection refused
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists."
I have installed CopSSH and set up id_rsa.pub keys and authorized key.
as mentioned in on github.
Is this problem is because of the dynamic IP address of my PC which is getting from the service provider? or what else is missing here?
I have tried the same in my office PC with same settings and installation, it works well with above git clone command, The difference is office PC has static IP but #home it is dynamic IP

Skip the ssh part as this is on the same machine. So from where you want the project to be in the D drive:
git clone C:/path_to_the_git_repo

Related

Cannot access git repo using Git for Windows or TortoiseGit

I do some development work for a friend, who runs his own Linux git server. Everything worked until he decided to harden his server. He decided 1024-bit keys weren't good enough, so I sent him a new 4096-bit public key.
Now I can no longer access the repository from Windows.
The repository url is ssh://git#1.2.3.4:2000/home/git/code.git (IP address changed to protect the innocent). Note that ssh runs on port 2000.
Trying to clone the repo from TortoiseGit gives "Server refused our key" in the git window, and "No supported authentication methods available (server sent: publickey, gssapi-keyex,gssapi-with-mic)" in an error dialog.
Trying from Git for Windows bash gives "fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists."
However, I can happily clone the same repo from a Linux VM running on the same machine, using the same key pair.
I have updated both Git for Windows and TortoiseGit with the latest version today.
[Later] I can actually log into the server from Putty and from Git bash:
$ ssh-agent bash
MINGW64 /e/folder
$ ssh-add rsa4096
Identity added: rsa4096 (rsa4096)
MINGW64 /e/folder
$ ssh -p 2000 git#1.2.3.4
Last login: Fri Jan 8 17:11:32 2021 from my.local.machine
(Ip addresses and machine names changed)
I can also login using "C:\Program Files\TortoiseGit\bin\TortoiseGitPlink.exe" -P 2000 (the GIT_SSH variable is set to C:\Program Files\TortoiseGit\bin\TortoiseGitPlink.exe)
Not sure what to try now - help!

Problem cloning bare repository from windows 10 git server to windows 7 client: does not appear to be a git repository

I created a bare repository on windows 10 workstation which is attached to company private network
cd c:\users\remoteusername\gitserver
mkdir myrepo.git
cd myrepo.git
git init --bare --shared=group
Thereafter I setup an ssh server on this windows server using Win32_OpenSSH
On my windows 7 client, I first create a pair of public/private ssh keys from git shell and added it to ssh-agent:
cd c:\users\localusername\.ssh\
ssh-keygen.exe -t ed25519
eval `ssh-agent -s`
ssh-add.exe id_ed25519
This generated public/private key pair id_ed25519.pub and id_ed25519 on my windows 7 client machine.
Then I copied the contents from public key id_ed25519.pub to file c:\users\remoteusername.ssh\authorized_keys on windows 10 server which hosts my bare git repository.
I restart ssh daemon on the windows 10 server
net stop sshd
net start sshd
hello
Next, on my windows 7 client, I connect to my companies private network through VPN. I first check if I could connect from my Windows 7 client to Windows 10 machine via ssh using my remoteusername:
ssh remoteusername#myorg.com
I was successfully able to connect using my remoteusername. However, if I used 'git' as user name with ssh, I can't connect:
ssh git#myorg.com
git#myorg.com's password:
Permission denied, please try again.
Next I try to clone my remote repository on my local machine but it fails:
git clone ssh://remoteusername#myorg.com/C:/Users/remoteusername/gitserver/myrepo.git testrepo
Cloning into 'testrepo'...
remoteusername#myorg.com's password: 'git-upload-pack' is not recognized as an internal or external command,
operable program or batch file.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
To resolve error with unrecognized command 'git-upload-pack', on my Windows 10 server, I added paths of git sub-folders with binaries to my environment PATH variable:
C:\Users\remoteusername\AppData\Local\Programs\Git\bin
C:\Users\remoteusername\AppData\Local\Programs\Git\mingw64\bin
I again try to clone my remote repository on my local machine but it fails with a different error:
git clone ssh://remoteusername#myorg.com:/C/Users/remoteusername/gitserver/myrepo.git testrepo
Cloning into 'testrepo'...
remoteusername#myorg.com's password:
fatal: ''/C/Users/remoteusername/gitserver/myrepo.git'' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Anyone knows what is that I am missing and how to resolve this ?

git clone SSL protocol error

I am trying to clone a git from a remote server in windows 7.
curl -v https://myserver
works git clone I get a:
fatal: unable to access 'https://myserver': Unknown SSL protocol error in connection to myserver:8080
another user using my computer was able to do it though. It's only my account that doesn't work?
any ideas?
thanks

UberSvn Remote access to Repository

I just installed uberSVN on my Windows computer. I created a repository and am able to access it on my local machine. How would I go about accessing this repository from another computer?
The machine you're on needs to be able to find the server and that might depend up DNS.
From a Windows command line on the server, type ipconfig. It should show you the IPv4 address of the server. On your local machine, use the URL http://xx.xx.xx.xx/svn/<repo> where xx.xx.xx.xx is the IP address of the Subversion server and <repo> is the name of your Subversion repository.
You can talk to your network guys about configuring DNS, so your Subversion server has an actual name instead of just an IP address. You can also edit the file C:\Windows\System32\drivers\etc\hosts file on the local Windows machine to give your Subversion server a name. Let's say the IP address of the Subversion server is 10.1.0.34 and your repository is foo, you could type in:
svn co http://10.1.0.34/svn/foo/trunk foo-trunk
Or you can edit the `C:\Windows\System32\drivers\etc\hosts file on your local Windows PC like this:
10.1.0.34 svnserver
And then use:
svn co http://svnserver/svn/foo/trunk foo-trunk
if your machines are in the same network, use your machine ip address as the svn server host(URL to repository in torttoise).
The url given for remote access is displayed when you setup a repository in uberSVN (or you can find it from the repository tab afterward).
It's usually http://your.ip.address:9880/reponame

Cannot clone git repo from ubuntu server with TortoiseGit

I'm facing some problems while git clone a repo from my ubuntu server running gitolite.
First, I got a public key from the developer who wants to clone the repository from the server. It was a rsa key created with putty. So I did the following to parse it from the putty-style to openssh format with:
ssh-keygen -i -f /tmp/ssh2/YourName.pub > /tmp/openssh/YourName.pub (taken from http://gitolite.googlecode.com/git/doc/ssh-troubleshooting.mkd?r=d3a663d03f1027f909732d55d0519bdd84edb62c)
and uploaded the public key along with a new entry for the repo and the new user in the config file to gitolite-admin repo.
So far, so good.
The developer is using **** along with putty to connect to the server, which is running git on a non-standard port and he keeps on getting the same error over and over again:
Cloning into 'D:\path\to\dirctory'...
error: Recv failure: Connection was reset while accessing http://sub.domain.com/info/refs
fatal: HTTP request failed
git did not exit cleanly (exit code 128)
Could anyone give me some advice about this issue?
EDIT:
In the meantime, we managed to git clone the repository by addressing it with the ssh:// protocol instead of git://, so it doesn't seem like it is a problem of the rsa_public.key or something like that.
The iptables on the server are accepting connections through the port for git, but it keeps on giving the above mentioned error.
The OP herom initially commented that the developer used git://git#remote.server.com:port/repo.git as an address.
I asked if there was any firewall issue, preventing the use of the git port (9418), but the OP mentioned:
no, there shouldn't be a firewall issue as iptables is accepting traffic for the git port - the port is forwarded and appears to be another port when connecting from outside...
Now, the developer cloned the repo through ssh:// (and even connecting to the ssh-port!)
I note that the git port can sometime be blocked, as illustrated in this thread.
If not on the client side, maybe on the server side.

Resources