Accessing (Pushing to) Github without username and password

Amanze Ogbonna
Sep 7, 2015 · 2 min read

1. Using SSH

If you need to do a push without username and password prompt, but you are always prompted, then your origin remote is pointing at the https url rather than the ssh url.

A way to skip typing my username/password when using https://github, is by changing the HTTPs origin remote which pointing to an HTTP url into an SSH url.

For example,
https url:<Username>/<Project>.git

ssh url:<Username>/<Project>.git

You can do:

git remote set-url origin<Username>/<Project>.git

to change the url.

Switching remote URLs from HTTPS to SSH

Open Terminal (for Mac and Linux users) or the command prompt (for Windows).

Change the current working directory to your local project.

List your existing remotes in order to get the name of the remote you want to change.

git remote -v
$ origin (fetch)
$ origin (push)
Change your remote’s URL from HTTPS to SSH with the git remote set-url command.

git remote set-url origin
Verify that the remote URL has changed.

git remote -v
$ Verify new remote URL
$ origin (fetch)
$ origin (push)

2. Using Static configuration

Static configuration of usernames for a given authentication context.

It is generally configured by adding this to your config:

[credential “"] username = me

The password was not declared because of security reasons. It is not advisable to store your password on an unsecure storage.

3. Credential helpers to cache or store passwords, or to interact with a system password wallet or keychain.

These are external programs from which Git can request both usernames and passwords
To use a helper, you must first select one to use. Git currently includes the following helpers:

cache: Cache credentials in memory for a short period of time.
store: Store credentials indefinitely on disk.


a.Find a helper.

$ git help -a | grep credential-

b.Read its description.

$ git help credential-foo

c.Tell Git to use it.

$ git config — global credential.helper foo



Amanze Ogbonna

Written by