Skip to content

Instantly share code, notes, and snippets.

@ahoward
Created June 6, 2012 21:42
Show Gist options
  • Save ahoward/2885020 to your computer and use it in GitHub Desktop.
Save ahoward/2885020 to your computer and use it in GitHub Desktop.
Fix Username/Password prompting for github repos cloned via https scheme

github recently switched to an https scheme as the default for cloning repos. as a side effect you may suddenly be prompted for a 'Username' and 'Password' when you push where, previously, you were able to do so without typing in credentials. the solution is to cause git to cache https credentials which is easy, since git uses curl under the covers

in your home directory create a file called '.netrc', for example

/Users/ahoward/.netrc

in it put these contents

machine github.com
login YOUR_GITHUB_USERNAME
password YOUR_GITHUB_PASSWORD

fixed!

@Ikyanakbaik
Copy link

Screenshot_20240525-104548
Ini gimana

@EJEASIntercom
Copy link

This code is very useful for me, thanks for sharing! EJEAS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment