Is there a way to generate a certificate or such so that my prod server can pull from my github repo without me authenticating every single time?
You can avoid being prompted for your password by configuring Git to cache your credentials for you. Once you've configured credential caching, Git automatically uses your cached personal access token when you pull or push a repository using HTTPS.
If Git is always asking you for your username and password when pushing or pulling your code from a GitHub repository, This is a common problem if you use HTTPS clone URL for cloning the repository. Let's see how to solve this! The https:// clone URLs are available on all public and private repositories.
Issue the command git fetch/push/pull. You will not then be prompted for the password.
You can create an access token and use it as username (without password).
Once you have your access token clone the repository:
git clone https://<your-access-token>@github.com/username/repo.git
Then you can pull without authenticating every single time.
This is the simplest method but will store the token plain text into .git/config To improve security you can setup password caching and clone as usual https:
git clone https://github.com/username/repo.git
If you want remove access of server to repository, just delete the access token in your application settings.
I also prefer to use https than ssh on deploy environments. Some times we don't have enough access privileges to handle with ssh, but https access to github is available even on cheaper hosting services.
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