Help Center/ CodeArts Repo/ FAQs/ Uploading and Downloading Code/ Error "The requested URL returned error: 401" Is Reported When HTTPS Is Used to Clone Code in CentOS
Updated on 2024-11-14 GMT+08:00

Error "The requested URL returned error: 401" Is Reported When HTTPS Is Used to Clone Code in CentOS

Symptom

Error The requested URL returned error: 401 is reported when HTTPS is used to clone code in CentOS.

Analysis

The built-in Git version of CentOS is 1.7.1 or earlier.

Solution

  1. Run the following command in Git Bash to check the Git version provided by the system: If the version is 1.7.1 or earlier, go to Step 2.

    git --version

  2. Run the following command to uninstall the Git provided by CentOS:

    yum remove git

  3. Download the latest version from the Git website and add Git to the environment variables.

    1. Download the Git source code package from GitHub. Replace the version number with the actual one.
      wget https://github.com/git/git/archive/Version number.tar.gz
    2. Decompress the source code package.
      tar zxvf Version number.tar.gz
    3. Switch to the Git source code directory containing the decompressed files.
      cd git-Version number
    4. Generate the configuration file.
      make configure
    5. Configure the Git installation path and code conversion library.
      ./configure --prefix=/usr/local/git --with-iconv=/usr/local/libiconv
    6. Compile the Git source code and documents.
      make all doc
    7. Install Git and its documents.
      make install install-doc install-html
    8. Add the path of the Git executable file to the system environment variables.
      echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
    9. Apply the environment variables.
      source /etc/bashrc