Ask Your Question

git does not honor ~/.netrc

asked 2015-03-03 10:54:28 -0500

drahnr gravatar image

updated 2015-03-03 11:49:21 -0500

mether gravatar image

I got a netrc in ~/.netrc with 600 permissions.

user justme
password abc123

But git always asks me for the password via askpass/cmdline.

Is there any way this can be made working?

edit retag flag offensive close merge delete


This question is very imprecise. Describe your specific problem so that it is easy to understand and reproducible.

Trismegistos gravatar imageTrismegistos ( 2015-03-04 15:41:01 -0500 )edit

According to , ~/.netrc is for FTP. Git does not use FTP; usually ssh or https. So I would not expect it to work with ~/.netrc.

randomuser gravatar imagerandomuser ( 2015-03-04 18:36:26 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2015-03-08 16:25:44 -0500

sdyroff gravatar image

updated 2015-03-09 08:29:12 -0500

It seems, that your format of the netrc is wrong, it should be:

login justme
password abc123

Additionally I think, that netrc authentication does only work for http(s) protocol. If you are using ssh as protocol for git, you should use public key authentication.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-03-03 10:54:28 -0500

Seen: 897 times

Last updated: Mar 09 '15