As I understand password prompt when pushing to github can be avoided by adding the username:password in the remote push url.
https://you:[email protected]/you/example.git
Is this a github specific arrangement or can this format be used (https://username:[email protected]/repo.git
) with any git remote?
A more secured way to authenticate you through GitHub than put your password in the remote URL would be, if you use HTTPS, to generate a new token in this GitHub page and then build your remote URL like this:
https://<username>:<token>@github.com/<username>/<project_name>.git
Is this a github specific arrangement?
It's not Github specific; this is actually Basic HTTP Authentication. The user:password@host
trick is a way of specifying the BA credentials in the URL.
...can this format be used (https://username:[email protected]/repo.git) with any git remote?
It works only for remotes that use the HTTP protocol. For SSH remotes you'll have to use SSH Keys instead.
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