Git authentication for http protocol (unix-like)
There is an easy way to connect to git repositories via ssh protocol without passwords - just create public key etc. But it doesn't work if you get repository via http/https protocol. In this case, you must enter your login and password at every remote operation.
To avoid this, you can create/edit ~/.netrc file, and add there one line:
machine <host> login <username> password <password>
For example, if your repository url is:
https://github.com/mysz/try-tiny-smartcatch.git
Entry in .netrc should looks like:
machine github.com login YOUR_LOGIN password YOUR_PASSWORD
Written by Marcin Sztolcman
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#