Wednesday, February 15, 2012

Saving tortoiseGit password

Took me a little while to find this, so I thought I would immortalize it here.

Apparently you need to save a file called _netrc in %USERPROFILE%

So a quick little batch file :

@echo off
SET /P HOST=What is the hostname i.e github.com?
SET /P USERNAME=What is your username?
SET /P PASSWORD=What is your password?

echo machine %HOST% login %USERNAME% password %PASSWORD% > "%USERPROFILE%\_netrc"

9 comments:

Jamo said...

Thank you! Such an obvious thing, you'd think they'd write an easy guide on their wiki...

Asif Ashraf said...

worked.....

Blake Niemyjski said...

Thanks a ton

Lythom said...

Worked for me too, thanks

Benjamin Buchholt said...
This comment has been removed by the author.
Benjamin Buchholt said...

Great! Made my day!

While code.google saiz ".netrc" i didn´t try "_netrc"...

Edit: whoops, you can´t edit, just delete and post again? Sry...

maheshram said...

This one really worked Thank you!

I have tried setting this form other sites didn't worked but the secret was putting in a single line. The bat script is really handy.

Michele Lepri said...

Thanks a lot man! This save a lot of time.. =)

Raitis Rolis said...

thx for help