Ask Your Question

Revision history [back]

click to hide/show revision 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:

  1. Encode the personal access token using URL encoding. Replace the '/' character with '%2F'.

  2. Copy the Git clone URL for the repository.

  3. Add the encoded token to the URL in the following format: https://<encoded-token>@github.com/<owner>/<repository>.git

  4. Open the terminal and navigate to the directory where you want to clone the repository.

  5. Enter the following command: git clone https://<encoded-token>@github.com/<owner>/<repository>.git

  6. 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