Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 55 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save nepsilon/0fd0c779f76d7172f12477ba9d71bb66 to your computer and use it in GitHub Desktop.
Save nepsilon/0fd0c779f76d7172f12477ba9d71bb66 to your computer and use it in GitHub Desktop.
How to use Mac KeyChain to store GitHub repos credentials? — First published in fullweb.io issue #108

How to use Mac KeyChain to store GitHub repos credentials?

You know the pain, you cloned a repo over HTTPS, and now Git asks you for your password each time you want to push or pull.

Chances are you already have the git credential-osxkeychain command installed. If not, just install Git with brew: brew install git.

Once installed, just tell Git to use the KeyChain to store your credentials:

git config --global credential.helper osxkeychain

Next time you clone a repo via HTTPS, you’ll be prompt for granting access to KeyChain. That’s it. Any future authentication will be done transparently by Git reading the KeyChain record.

@sushobhit-lt
Copy link

cool stuff !! thanks

@muhammadashfaq
Copy link

Cool

@aaroncurtisyoga
Copy link

Major help! Thank you so much.

@spsaxena
Copy link

spsaxena commented Apr 2, 2021

Thanks

@tdiprima
Copy link

Brief and to the point. Cheers, thanks a lot! 👍

@Workwithnk
Copy link

Thanks , that's work very well

@u007
Copy link

u007 commented Jul 25, 2022

need to also add this in ssh config

cat ~/.ssh/config
Host *
    UseKeychain yes

@oscar066
Copy link

oscar066 commented Mar 6, 2023

thanks

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