Is it possible to get windows process some code after an alias in the cmd? Basically I want to do sth. like this:
doskey mysvn = D:\portableSVN\bin\svn.exe --config-dir D:\portableSVN\config
mysvn up
mysvn ci -m "message"
This does not work, after interpreting mysvn it just stops and I get:
Subcommand argument required
Type 'svn help' for usage.
Currently, I modify the PATHfor the session and use the standard config folder, but I would rather not have my credentials and proxy settings on every pc I use my portable svn on. Of course I can delete them afterwards, but still they are recoverable.
If necessary, it is also possible to execute batch files as long as they don't need admin rights.
Try with
doskey mysvn=D:\portableSVN\bin\svn.exe --config-dir D:\portableSVN\config $*
See doskey /? for more information
I need to create a .cmd file that pushes my repository to remote. However, .cmd files are open in standard command line and if I run "git push" in it, I guess standard HTTP authentication is used - I'm not asked for passphrase for my ssh key file and the authentication of course fails.
Pushing works fine in Git shell (Powershell configured for git from "Github for Windows"), however, how can I create clickable shortcut in Windows which runs a command in this shell?
I tried
C:\Users\Richard\AppData\Local\GitHub\GitHub.appref-ms --open-shell "push.cmd"
which did not work.
Also, I tried to run the .cmd file in normal shell adding
#setlocal
#set PLINK_PROTOCOL=ssh
git push
as advised here:
Running a batch file in git shell
but it made no difference - no query for my ssh key, authentication fails.
Can you help me make one of the two solutions working? Thanks.
The field for uploading a Putty Private Key is currently disabled on my Tortoisegit.
(source: iforce.co.nz)
Although I currently have valid paths to PuttyGen, GitBash, PuTTY and TortoiseGitPLink.exe. With the environment variable GIT_SSH leading to C:\Program Files\TortoiseGit\bin\TortoisePLink.exe
How to use PuTTY for git cli and git bash?
Create an environment variable called "GIT_SSH" with the path to the PuTTY plink.exe or preferably to TortoiseGitPLink.exe. This can be done on the command line by executing "set GIT_SSH=PATH_TO_PLINK.EXE" ("C:\Program Files\TortoiseGit\bin\TortoiseGitPLink.exe" on default installations) or permanently.
(source: iforce.co.nz)
This just bit me too. The problem is that you have checked out over https instead of using the git protocol (git#github.com:somerepo.git). Try that and see if it helps.
on my new computer, I setup git and my putty.exe and ssh key etc. just fine.
So I do a:
git pull origin
and then at the command prompt, I am asking for a password.
I have no idea what password it wants, and then it also asks for my server's password after a few failed attempts at the first password.
it asks for:
blahblah#serveradmin.com password:
What is going on?
(my git rep is hosted on a shared unix isp)
I already setup pageant to use my private key, and it gave me a popup to enter my passphrase. This is how it works on my old computer, and then when I open git-bash and do a 'git pull origin' it works fine without asking me anything.
Update II
So let me summarize what is happending here:
I have the exact same setup at my office computer (windows7) (desktop), and it works fine w/o asking me any questions. All I do b4 using git is run a .bat file that loads up pageant.exe:
C:\putty\pageant.exe "E:\code\pg_pk.ppk"
Then doing a git pull origin works fine, doesn't ask me for any password.
I had this on my laptop also, and it worked just like my office computer UNTIL I installed windows 7 on it. Now it asks me for a password even though pageant.exe is running (I can see it in my taskbar, and the key is loaded).
So today I grabbed the .bat file and the entire /putty folder and put it on my laptop, still doesn't work, it is asking me for a password when I type: git pull origin
(I am running the same version of git on both computers)
Really confused, what could it be?
It isn't clear from your question whether or not you set up Git to actually use PuTTY. What is the content of your GIT_SSH environment variable?
It should be set to the full path to plink.exe. Even better yet: if you also use TortoiseSVN or TortoiseHg, set GIT_SSH to their TortoisePlink.exe. TortoisePlink has been modified to not read from the standard input, but instead pop up a dialog window, if something goes wrong. Git redirects standard input, so that you cannot actually type anything into plink, if, for example, your server's IP address changes and plink asks you to type yes to confirm it, that won't work. (You'll have to invoke plink or putty manually, then say yes and they will save it in the registry.) TortoisePlink will instead pop up a Yes/No dialog box.
You ssh key passphrase.
To remedy, you can recreate a key on your new machine using ssh-keygen and then save in the git origin
I'd double-check your SSH keys--looks like it's not properly sending your identity.
I have found that pageant sometimes just does not work. IMHO it is far easier to set it up using a blank password key with command line ssh client. From memory:
Generate public/private key using git bash:
ssh-keygen -t RSA -C email#address
DO NOT specify password.
Upload the the contents of %USERPROFILE%.ssh\id_rsa.pub
Git should just work, including windows command line, git bash, tortoise, git extensions etc.
I encountered this problem as well. What worked for me, oddly enough, was not creating the repository via TortoiseGit, but rather via git init.
I am trying to do a command line svn update on my windows machine (to use in a batch file), and I want it to emulate what my settings are in the Tortoise SVN GUI.
In the tortoise settings, we have to specify the following in the SSH client...
C:\Program Files\TortoiseSVN\bin\TortoisePlink.exe -l usernamehere -pw mypassword -i C:\Users\Mike\Documents\myprivatekey.ppk
and I simply right click update...
does anyone know how I would use the svn.exe to emulate the above? (using plink with a private key?)
If I am not clear on something please comment and I will work it out.
Best,
Mike
svn+ssh command line
Basically,
Edit the file c:\Documents and Settings\user\Application Data\Subversion\config
Locate the section named [tunnels]
Add the following line : ssh=c:/path/to/plink.exe -i c:/path/to/your/key.ppk
I couldn't get subversion to work with plink, so I used Git's SSH. Details on my wiki at http://wiki.dandascalescu.com/howtos/subversion/subversion_access_through_ssh_on_windows.