Pull from github without authentication every time

This is what Deploy Keys are for.

That help article explains what deployment authentication methods GitHub supports and gives some pointers to help decide between them.

In my limited experience, deployment SSH keys are probably the simplest to set up.


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.