1 | initial version |
When cloning via HTTPS using a personal access token that includes the characters '/', the method involves encoding the token and adding it to the Git URL. Here are the steps:
Encode the personal access token using URL encoding. Replace the '/' character with '%2F'.
Copy the Git clone URL for the repository.
Add the encoded token to the URL in the following format: https://<encoded-token>@github.com/<owner>/<repository>.git
Open the terminal and navigate to the directory where you want to clone the repository.
Enter the following command: git clone https://<encoded-token>@github.com/<owner>/<repository>.git
Press Enter and Git should clone the repository using the personal access token.
Example: If your personal access token is abc/def, the encoded token will be abc%2Fdef. If you want to clone the repository owned by johndoe with the name myrepo using the encoded token, the Git clone URL will be: https://abc%2Fdef@github.com/johndoe/myrepo.git
The command to clone the repository in the terminal will be: git clone https://abc%2Fdef@github.com/johndoe/myrepo.git