Maven release:prepare cannot connect to SVN URL [duplicate] - maven

I'm having trouble trying to checkout a repo using the following syntax on a Windows 7 workstation with TortoiseSvn:
svn co svn+ssh://user#ip/repo .
What I've done to test this issue:
Modified the network settings of TortoiseSvn to point to ..\TortoisePlink.exe
Successfully established an ssh connection to the target machine with no issues
Successfully checked out repos from workstations running Ubuntu with OpenSsh
When I try to do the above syntax from the command line on the Windows 7 workstation I get the error:
svn: E720087: Unable to connect to a repository at URL 'svn+ssh:///user#ip/repo'
svn: E720087: Can't create tunnel:The parameter is incorrect.
Interestingly, if I use the tortoise gui to browse to the repo I can successfully open and check out the repo. But I need to do it from the command line for scripting purposes.
Any suggestions?

For svn+ssh to work with Tortoise, make sure %SVN_SSH% is set to your ssh client (probably plink.exe from Tortoise or Putty) and the path must be written either with forward slashes / or with escaped backslashes \\.
Try to set %SVN_SSH% with the absolute path of plink while escaping the backslashes, something like C:\\Program Files\\TortoiseSVN\\bin\\TortoisePlink.exe instead of ..\TortoisePlink.exe

Check that the path to TortoisePlink is not corrupted in your Tortoise SVN config...
Start > Program Files > Tortoise SVN > Settings
Under General Settings, "Subversion configuration file:" click "Edit"
This will open the config file in Notepad
Scroll down to the [tunnels] section and check the value for ssh which should be uncommented, use double slashes etc - I had problems as there seemed to be a Unicode control code at the beginning of the path.
### On Windows, if you are specifying a full path to a command,
### use a forward slash (/) or a paired backslash (\\) as the
### path separator. A single backslash will be treated as an
### escape for the following character.
ssh = C\:\\Program Files\\TortoiseSVN\\bin\\TortoisePlink.exe

Connect to server, using Plink, by hand. Define needed and correct (for you) startup-options of plink
Add this line (use tortoiseplink as windowless-plink) into %APPDATA%config file, [tunnels] section

It also turns out the the line in the Tunnels section of the config file is case sensitive.
For example:
sh = $SVN_SSH "C:/path/putty/plink.exe" -2 -C -i "C:/path/username/serversvn.ppk"
might work
and
sh = $SVN_SSH "C:/path/PuTTY/plink.exe" -2 -C -i "C:/path/username/serversvn.ppk"
won't work

I had a similar, but slightly different issue.
I tried connecting to our SSH+SVN server through Pycharm and it hung. Tried the regular way through windows right click, tortoiseSVN and got this same "Can't create tunnel" issue.
I believe this issue was created because I tried to connect to my repo via pycharm, which automatically created a tunnel line in the tortoise SVN config file.
I followed Kevin Sadler's answer, but just commented out the ssh line, and it was back to normal. Checkouts and commits were working again.
Kevin's answer:
Check that the path to TortoisePlink is not corrupted in your Tortoise SVN config...
Start > Program Files > Tortoise SVN > Settings
Under General Settings, "Subversion configuration file:" click "Edit"
This will open the config file in Notepad
Scroll down to the [tunnels] sections. Comment out the SSH line.

Related

How to use svn+ssh with Tortoise SVN from the command line

I'm having trouble trying to checkout a repo using the following syntax on a Windows 7 workstation with TortoiseSvn:
svn co svn+ssh://user#ip/repo .
What I've done to test this issue:
Modified the network settings of TortoiseSvn to point to ..\TortoisePlink.exe
Successfully established an ssh connection to the target machine with no issues
Successfully checked out repos from workstations running Ubuntu with OpenSsh
When I try to do the above syntax from the command line on the Windows 7 workstation I get the error:
svn: E720087: Unable to connect to a repository at URL 'svn+ssh:///user#ip/repo'
svn: E720087: Can't create tunnel:The parameter is incorrect.
Interestingly, if I use the tortoise gui to browse to the repo I can successfully open and check out the repo. But I need to do it from the command line for scripting purposes.
Any suggestions?
For svn+ssh to work with Tortoise, make sure %SVN_SSH% is set to your ssh client (probably plink.exe from Tortoise or Putty) and the path must be written either with forward slashes / or with escaped backslashes \\.
Try to set %SVN_SSH% with the absolute path of plink while escaping the backslashes, something like C:\\Program Files\\TortoiseSVN\\bin\\TortoisePlink.exe instead of ..\TortoisePlink.exe
Check that the path to TortoisePlink is not corrupted in your Tortoise SVN config...
Start > Program Files > Tortoise SVN > Settings
Under General Settings, "Subversion configuration file:" click "Edit"
This will open the config file in Notepad
Scroll down to the [tunnels] section and check the value for ssh which should be uncommented, use double slashes etc - I had problems as there seemed to be a Unicode control code at the beginning of the path.
### On Windows, if you are specifying a full path to a command,
### use a forward slash (/) or a paired backslash (\\) as the
### path separator. A single backslash will be treated as an
### escape for the following character.
ssh = C\:\\Program Files\\TortoiseSVN\\bin\\TortoisePlink.exe
Connect to server, using Plink, by hand. Define needed and correct (for you) startup-options of plink
Add this line (use tortoiseplink as windowless-plink) into %APPDATA%config file, [tunnels] section
It also turns out the the line in the Tunnels section of the config file is case sensitive.
For example:
sh = $SVN_SSH "C:/path/putty/plink.exe" -2 -C -i "C:/path/username/serversvn.ppk"
might work
and
sh = $SVN_SSH "C:/path/PuTTY/plink.exe" -2 -C -i "C:/path/username/serversvn.ppk"
won't work
I had a similar, but slightly different issue.
I tried connecting to our SSH+SVN server through Pycharm and it hung. Tried the regular way through windows right click, tortoiseSVN and got this same "Can't create tunnel" issue.
I believe this issue was created because I tried to connect to my repo via pycharm, which automatically created a tunnel line in the tortoise SVN config file.
I followed Kevin Sadler's answer, but just commented out the ssh line, and it was back to normal. Checkouts and commits were working again.
Kevin's answer:
Check that the path to TortoisePlink is not corrupted in your Tortoise SVN config...
Start > Program Files > Tortoise SVN > Settings
Under General Settings, "Subversion configuration file:" click "Edit"
This will open the config file in Notepad
Scroll down to the [tunnels] sections. Comment out the SSH line.

'ssh-keygen' is not recognized as an internal or external command

I run git push -u origin master
It tells me that "Permission denied (public key) fatal: The remote end hung up unexpectedly"
Then I looked up on the internet and found that I had to generate an ssh key for my account on GitHub. However, upon doing so, when I tried to do ssh-keygen -t rsa "email#youremail.com" it simply said ssh-keygen is not recognized. I tried doing mkdir C:\ssh but that didn't work. If it helps I'm using Ruby Rails and I'm on a Windows computer. Could anyone help me?
2012:
ssh-keygen.exe is part of msysgit:
C:\path\to\msysgit1.7.11\bin\ssh-keygen.exe
if your %PATH% includes C:\path\to\msysgit1.7.11\bin\, you will have ssh-keygen.
Update 2015:
ssh-keygen.exe is part of Git For Windows, whose releases include PortableGit-2.4.3.1-2nd-release-candidate-64-bit.7z
c:\path\to\PortableGit-2.4.3.1-2nd-release-candidate-64-bit\usr\bin\ssh-keygen.exe
That means the %PATH% must include c:\path\to\PortableGit-2.4.3.1-2nd-release-candidate-64-bit\usr\bin (without the ssh-keygen.exe)
As I explained before, Git for Windows will soon phase out msysgit.
I detailed in "Why is it that if you download Git 2.0 from the net, you always get a 1.9.4 installer package?" how this new version is based on the more recent msys2 project.
I just had this issue and thought I'd share what I thought was an easier way around this.
Open git-bash and run the same command with the addition of -C since you're commenting in your email address: ssh-keygen -t rsa -C "email#youremail.com" command. That's it.
git-bash should have been installed when you installed git. If you can't find it you can check C:\Program Files\Git\Git Bash
The first time I did this it failed to create the .ssh folder for me so I had to open a standard Command Prompt and mkdir C:\Users\yourusername\.ssh
I followed below in windows (With Git for Windows installed)
Run "Git Gui" (Start --> Git --> Git Gui)
Click Help and then Show SSH Key
Click Generate Key if you do not have one already
Note:- this creates the key files under your personal profile folder C:\Users\YourUserID\.ssh\
No need to add anything to environmental variables! Just open up git bash and perform command the ssh-keygen in there.
Link to download git bash here
I found an easy solution to fix this :
In the command prompt, go to your git\bin directory,
and then execute your commands from here
If you have installed Git, and is installed at C:\Program Files, follow as below
Go to "C:\Program Files\Git"
Run git-bash.exe, this opens a new window
In the new bash window, run "ssh-keygen -t rsa -C""
It prompts for file in which to save key, dont input any value - just press enter
Same for passphrase (twice), just press enter
id_rsa and id_rsa.pub will be generated in your home folder under .ssh
Just go to heroku.bat and add:
#SET PATH="D:\Program Files (x86)\Git\bin";%PATH% after #SET PATH=%HEROKU_RUBY%;%PATH%
in my case it's in D:\Program Files (x86)\Git\bin, change it to the path you've installed Git to. (i just left it with my path so it will be clearer on how to write this)
I think you can add the location of the file ssh-keygen.exe in the PATH environment variable. Follow the steps: Go to My Computer->Right click->Properties->Advanced System Settings->Click Environmental Variables. Now click PATH and then click EDIT. In the variable value field, go to the end and append ';C:\path\to\msysgit1.7.11\bin\ssh-keygen.exe' (without quotes)
don't do anything just type in your command prompt
C:\> sh
then you got like this
sh-4.4$
# type here
ssh-4.4$ ssh-keygen -t rsa -b 4096 -C "example#example.com"
this should must work.
For windows you can add this:
SET PATH="C:\Program Files\Git\usr\bin";%PATH%
You probably should check this. Windows doesn't have that command built in.
I got it fixed by just adding ssh-keygen to my environment variables.
for those who does not choose BASH HERE option. type sh in cmd then they should have ssh-keygen.exe accessible
In my machine, ssh-keygen was available from powershell.

Using SVN on Windows with Cygwin and TortoiseSVN

I'm quite a beginner with version control so I might be doing something very wrong.
I want to be able to access a local repository both in cygwin and in TortoiseSVN (or other Windows app). The trouble is, in cygwin I have to use the
file:///cygdrive/c/... paths while TortoiseSVN needs
file:///c:/....
How can I make these two work together? Can I use some other path/protocol that both understand?
Thanks!
Easy way is to use the svnserve program that comes with Subversion. This should be in Cygwin. All you need to do is start up the svnserve and use svn:// as the protocol instead of file://.
First, you need to modify your repository. You'll have to edit two files: svnserve.conf and passed.
$ cd /cygdrive/c/.../repos_dir
$ cd conf
$ vi svnsever.conf # Change the "# password-db = passwd" line & remove the "#"
$ vi passwd # Setup the user and password entry
Next, you start the server:
$ cd .. # Back to the repository directory
$ svnserve -r $PWD -d
And, that's it.
Now, you can do your checkout this way:
$ svn co svn://localhost/dir/to/check/out
This will be the same URL in both cygwin and in Tortoise
WORD 'O WARNING
There is no guarantee that different subversion clients will produce working directories that will work with other subversion clients.
Fortunately, Tortoise and the standard Subversion command line client seem to be okay. I've been able for the last few years to switch between the Subversion command line client and ToroiseSVN. HOWEVER, you do have to make sure that they're both ether post version 1.7 clients or pre 1.7 clients. If your Cygwin client is version 1.6.7 and your Tortoise client is 1.7.5, you can't share the working directory. Use the svn version command to check your Cygwin client, and check the About Box on Tortoise.
Again, there's no guarantee that both clients can share the same working directory, so if there are problems, you are on your own.
There is a better way. Simply link the directory.
ln -s /cygdrive/c /C:
now it should work.
Credit goes to Mark Malaknov
You can read it here:
http://markmal.blogspot.com/2012/11/how-to-use-cygwin-svn-and-tortoisesvn.html
If you (re-)install TortoiseSVN and select the option to install the (Windows) command-line tools, but don't install the Cygwin/Linux version of these tools from the Cygwin installer (or remove them), then your Windows tools will still be available via Cygwin.
These should accept Windows paths as if you were invoking them from the Command Prompt (although you might have to put them in quotes to avoid the bash shell from interpreting them)

Git with SSH on Windows

I've went through the excellent guide provided by Tim Davis which is about configuring Git to work with SSH under Windows in order to produce a Git Server in order to have a main place for my DVCS.
I am in the process of creating a clone for my project. I’ve went through all the steps till this point, but I keep getting this from TortoiseGit:
git.exe clone -v “ssh://Administrator#127.0.0.1:22/SSH/Home/administrator/myapp.git” “E:\GitTest\myapp”
bash: Administrator#127.0.0.1: command not found
Initialized empty Git repository in E:/GitTest/myapp/.git/
fatal: The remote end hung up unexpectedly
Success
and nothing gets cloned.
BTW: The TortoisePLink comes up just before this message appears and asks me: “login as:” ( I thought that this info is given in the command, i.e: Administrator#blahblah.
My home variable is set to the correct place:
From a Git Bash shell:
echo $HOME
/c/SSH/home/Administrator
I’ve also tried using Putty’s plink instead of TortoisePLink (in both Git’s and TortoiseGit’s installation). This time the error was narrowed down to:
git.exe clone -v “ssh://Administrator#127.0.0.1:22/c:/SSH/Home/administrator/myapp.git” “E:\GitTest\myapp”
Initialized empty Git repository in E:/GitTest/myapp/.git/
fatal: The remote end hung up unexpectedly
I fought with this problem for a few hours before stumbling on the obvious answer. The problem I had was I was using different ssh implementations between when I generated my keys and when I used git.
I used ssh-keygen from the command prompt to generate my keys and but when I tried "git clone ssh://..." I got the same results as you, a prompt for the password and the message "fatal: The remote end hung up unexpectedly".
Determine which ssh windows is using by executing the Windows "where" command.
C:\where ssh
C:\Program Files (x86)\Git\bin\ssh.exe
The second line tells you which exact program will be executed.
Next you need to determine which ssh that git is using. Find this by:
C:\set GIT_SSH
GIT_SSH=C:\Program Files\TortoiseSVN\bin\TortoisePlink.exe
And now you see the problem.
To correct this simply execute:
C:\set GIT_SSH=C:\Program Files (x86)\Git\bin\ssh.exe
To check if changes are applied:
C:\set GIT_SSH
GIT_SSH=C:\Program Files (x86)\Git\bin\ssh.exe
Now git will be able to use the keys that you generated earlier.
This fix is so far only for the current window. To fix it completely you need to change your environment variable.
Open Windows explorer
Right-click Computer and select Properties
Click Advanced System Settings link on the left
Click the Environment Variables... button
In the system variables section select the GIT_SSH variable and press the Edit... button
Update the variable value.
Press OK to close all windows
Now any future command windows you open will have the correct settings.
Since this keeps coming up in search results for making git and github work with SSH on Windows (and because I didn't need anything from the guides above), I'm adding the following, simple solution.
(Microsoft says they are working on adding SSH to Visual Studio, and GitHub for Windows still doesn't support SSH...)
1. I installed "git for Windows" (which includes ssh and a bash shell)
https://git-scm.com/download/win
2. From the included bash shell (which, for me, was installed at: C:\Program Files\Git\git-bash.exe)
cd to the root level of where you want your repo saved (something like: C:\code\github\), and
Type:
eval $(ssh-agent -s) && ssh-add "C:\Users\YOURNAMEHERE\.ssh\github_rsa"
3. Type: (the SSH link from the repo)
git clone git#github.com:RepoName/Project.git
you are using a smart quote “ instead of " here:
git.exe clone -v “ssh://
^^^
Make sure you use the plain-old-double-quote.
I've found my ssh.exe in C:/Program Files/Git/usr/bin directory.
If Git for windows is installed, run Git Bash shell:
bash
You can run ssh from within Bash shell (Bash is aware of the path of ssh)
To know the exact path of ssh, run "where" command in Bash shell:
$ where ssh
you get:
c:\Program Files\Git\usr\bin\ssh.exe
I was trying to solve my issue with some of the answers above and for some reason it didn't work. I did switch to use the git extensions and this are the steps I did follow.
I went to Tools -> Settings -> SSH -> Other ssh client
Set this value to C:\Program Files\Git\usr\bin\ssh.exe
Apply
I guess that this steps are just the same explained above. The only difference is that I used the Git Extensions User Interface instead of the terminal. Hope this help.
When I typed where ssh it showed me multipe ssh.exe
user#pc MINGW64 /c/dev/
$ where ssh
C:\Users\user\AppData\Local\Programs\Git\usr\bin\ssh.exe
C:\Windows\System32\OpenSSH\ssh.exe
Deleting / moving these exe helped:
# copy from
# C:\Users\user\AppData\Local\Programs\Git\usr\bin
# to something like
# C:\Users\user\AppData\Local\Programs\Git\usr\bin\backup-ssh
ssh-agent.exe
ssh.exe
ssh-add.exe
This solved the issue for me.

Want to download a Git repository, what do I need (windows machine)?

I want to download this open source application, and they are using Git. What do I need to download the code base?
Update
How do I change the working directory when I am using Git Bash? (I want to download the repo at a certain directory, using pwd tells me I will be downloading the repo where I don't want it.
Download Git on Msys. Then:
git clone git://project.url.here
Install mysysgit. (Same as Greg Hewgill's answer.)
Install Tortoisegit. (Tortoisegit requires mysysgit or something similiar like Cygwin.)
After TortoiseGit is installed, right-click on a folder, select Git Clone..., then enter the Url of the repository, then click Ok.
This answer is not any better than just installing mysysgit, but you can avoid the dreaded command line. :)
I don't want to start a "What's the best unix command line under Windows" war, but have you thought of Cygwin? Git is in the Cygwin package repository.
And you get a lot of beneficial side-effects! (:-)
To change working directory in GitMSYS's Git Bash you can just use cd
cd /path/do/directory
Note that:
Directory separators use the forward-slash (/) instead of backslash.
Drives are specified with a lower case letter and no colon, e.g. "C:\stuff" should be represented with "/c/stuff".
Spaces can be escaped with a backslash (\)
Command line completion is your friend. Press TAB at anytime to expand stuff, including Git options, branches, tags, and directories.
Also, you can right click in Windows Explorer on a directory and "Git Bash here".

Resources