<-- Back

How to connect to the GIT repository when encountering the error: LibGit2Sharp.LibGit2SharpException: request failed with status code: 403

Introduction

Studio Pro uses LibGit2 for fast local Git operations, but switches to the Git CLI for remote actions (fetch, pull, push) because LibGit2 is too slow for network communication. This is why Git for Windows is required. However, Git for Windows does not automatically use system proxy settings. 

If the connection to Git repositories is from behind a proxy server, the Git proxy has to be manually configured. 

Environment

Version Control

Instructions/Procedure

If the log below is preventing connecting to GIT repository, it points to the Proxy configuration on the machine. 

LibGit2Sharp.LibGit2SharpException: request failed with status code: 403

Currently, it's not possible to use Git from behind an authenticated proxy, so the Git version control proxy settings have to be configured in one of two ways. 

  • By setting the environment variables http_proxy, https_proxy, or all_proxy, or
  • By configuring the proxy directly in the project’s local Git configuration file (.git/config).

To configure the proxy in the local Git configuration:

  1. Open Git Bash

  2. Navigate to the project folder

  3. Run the following command to set the proxy:

git config --local http.proxy [protocol://][user[:password]@]proxyhost[:port]
  1. Verify the proxy setting

git config --local http.proxy

If configured correctly, the command will display the proxy URL entered in Step 3.

Note that the --global modifier can be used instead of --local to apply the proxy settings system-wide. However, this is not recommended if Git is used for purposes other than Mendix development, as it will affect all Git repositories on the machine.

Outcome

The proxy configuration enables smooth communication between Mendix Studio Pro and remote Git servers when working behind a proxy.

  • Studio Pro can successfully connect to remote Git repositories

  • Fetch, pull, and push operations will work without proxy errors

  • Remote version control actions will complete without connection timeouts

  • No changes will affect other Git projects (if --local was used)

Internal information related

177208,191173, 206836, 270377, 271687

Additional information

Mendix documentation: Troubleshooting Version Control 

Have more questions? Submit a request

0 Comments

Article is closed for comments.

To provide feedback, please open a ticket here. Don't forget to include the article's URL along with the feedback you would like to provide.