SSH Key-Based Passwordless Access for Private GitHub Repositories

My SSH key-based authorization kept failing on a private GitHub repo on a remote machine, even though my SSH keys for that machine were properly registered on the GitHub account. The solution was to force the “git” protocol instead of “http”.

That is, instead of:

url =


url =

in your “.git/config:

	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
[remote "origin"]
    url =
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
	remote = origin
	merge = refs/heads/master