.netrc — Access to git repo without typing password any time (for MacOSX).

Thân Đặng
Sep 23, 2021

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.

  1. Create .netrc file:
    vi ~/.netrc
  2. 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>
  3. Set permission for file:
    chmod 600 ~/.netrc
  4. Enjoy your day. Here is my sample

--

--