Search code examples
rdevtools

`devtools::install_git()` with stored git credentials


Currently using install_git() to install from a repo protected by Azure Active Directory results in an error:

> devtools::install_git("https://myteam.visualstudio.com/MyProject/_git/MyAwesomeRPackage")
Downloading git repo https://myteam.visualstudio.com/MyProject/_git/MyAwesomeRPackage
Installation failed: Error in 'git2r_clone': Unable to authenticate with supplied credentials

even though the AAD credentials are stored in the git credential manager. For example, calling this from the command line works just fine:

git clone https://myteam.visualstudio.com/MyProject/_git/MyAwesomeRPackage

is there any way to have R use the credentials from the git credential manager for this install?


Solution

  • Try the git parameter, e.g., git = "external".