Github clone with oauth access token

Inside a script I am trying to clone a Github repository with an oauth token.

According to this tutorial:

  • Ansible 2.1.0 using become/become_user fails to set permissions on temp file
  • Jenkins git commit for specific branch triggers build jobs for other branches too
  • See complete history of changes in smartGit
  • Changes not reflected in PhpStorm after GIT checkout on remote machine
  • Use custom NuGet feed in Visual Studio Online
  • How do you see which commit deleted a file from the repo?

    I should be able to build a command for it like this:

    git clone https://<token>

    If I try this manually with a proper access token, it still asks for my password.

    If I try it on the commandline I am simply getting a repository not found error.

    The article is from 2012 and I cannot find any API documentation for this. So I am wondering if this still works.

  • Add git branch after initial fetch in the same svn-remote
  • What is the meaning of :/ (colon, forward slash) in the 2.0 version of git add --update syntax?
  • troubles when I use homebrew
  • Jenkins Branches to Build - Exclude Single Branch
  • git: Unable to Clone Private Repositories, Error: Repositories not found
  • Kernel building: how are the “torvalds” and “stable” repos related?
  • One Solution collect form web for “Github clone with oauth access token”

    I turned out to be a scope issue. I of course needed full repo scope since I was trying to clone a private repository.

    It’s a shame Github does not have some clearer error messages for these kind of things, but security wise I understand why.

    For anyone trying to figure out what is wrong when trying out something like this, I would suggest to create a personal access token with full access to everything:

    settings > developer settings > personal access tokens > generate new token

    This way you can easily test if it is a scope issue by comparing your token with a personal access token that has access rights for everything.

    Thanks for anyone who still took the time to read this.

    Git Baby is a git and github fan, let's start git clone.