From 30c64ed8ec619167f9c2de94166bab1ff6dee6c7 Mon Sep 17 00:00:00 2001 From: Qi Date: Mon, 12 Aug 2024 12:16:21 +0800 Subject: [PATCH] docs(DEVELOPER.md): fix the guide of authentication --- DEVELOPER.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/DEVELOPER.md b/DEVELOPER.md index 19ffb3b6edb8..c7ab38be99d1 100644 --- a/DEVELOPER.md +++ b/DEVELOPER.md @@ -160,6 +160,23 @@ An alternative is to edit the `~/.cargo/config` file and add the following lines git-fetch-with-cli = true ``` +You also have to make sure the `git` CLI is using the proper protocol to fetch the dependencies +if you are authenticated with +[Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token). + +```shell +# If you are using the HTTPS protocol to clone the repository +# YOU ONLY NEED TO DO THIS ONLY ONCE FOR THIS DIRECTORY +git config --local url."https://${GITHUB_TOKEN}@github.com/".insteadOf 'git@github.com:' +git config --local url."https://${GITHUB_TOKEN}@github.com".insteadOf 'https://github.com' + + +# If you are using the SSH protocol to clone the repository +# YOU ONLY NEED TO DO THIS ONLY ONCE FOR THIS DIRECTORY +git config --local url.'git@github.com:'.insteadOf 'https://github.com' +git config --local url.'ssh://git@github.com/'.insteadOf 'https://github.com/' +``` + Finally, we start the build process: ```