.netrc — Access to git repo without typing password any time (for MacOSX).
We’re usually using local git configuration to store username and password for access. Especially if you’re using https instead of ssh. Most of us are using gihub/gitlab/bitbucket as regular git repositories. Below is a different approach for config access.
As Github has note: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
- Create .netrc file:
vi ~/.netrc - Put your host and cred with below format (You can put more than one, so feel free to add new):
machine <host>
login <LOGIN>
password <PASSWORD> - Set permission for file:
chmod 600 ~/.netrc - Enjoy your day. Here is my sample