I'm using Github SSH to push my files. I have ssh configured, but every time I init a new repo I need to change the .git/config file manually to change
url = https://github.com/alex3wielki/project-setup.git
to
url = ssh://[email protected]/alex3wielki/project-setup.git
but still I have to add my credentials on the first push. Is there any way to make it automatic?
Yes
If Git prompts you for a username and password every time you try to interact with GitHub, you're probably using the HTTPS clone URL for your repository.
Using an HTTPS remote URL has some advantages: it's easier to set up than SSH, and usually works through strict firewalls and proxies. However, it also prompts you to enter your GitHub credentials every time you pull or push a repository.
You can configure Git to store your password for you like this below :
Store your credential using this
Caching your GitHub password in Git (Tip: You need Git 1.7.10 or newer to use the credential helper) :
git config --global credential.helper wincred
In case you want to delete your credential :
Deleting your credentials via the command line
git credential-osxkeychain erase
host=github.com
protocol=https
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With