# Git Behind A Proxy Server - How to modify your Git commands for proxies

**URL:** <https://forum.freecodecamp.org/t/git-behind-a-proxy-server-how-to-modify-your-git-commands-for-proxies/13187>\
**Category:** freeCodeCamp Contributors\
**Tags:** guide\
**Created:** [June 21, 2016, 8:14pm UTC](https://forum.freecodecamp.org/t/git-behind-a-proxy-server-how-to-modify-your-git-commands-for-proxies/13187 "2016-06-21T20:14:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![camperbot](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/camperbot/32/18364_2.png) [@camperbot](https://forum.freecodecamp.org/u/camperbot)\
**Post date:** [June 21, 2016, 8:14pm UTC](https://forum.freecodecamp.org/t/git-behind-a-proxy-server-how-to-modify-your-git-commands-for-proxies/13187/1 "2016-06-21T20:14:22Z")

</div>

**Use-cases**

You might need to modify `git` commands that access (to update and read from) remote repositories if your internet access is through a [proxy server](https://en.wikipedia.org/wiki/Proxy_server).

Proxy servers are common in college and business type environments.

You can [locate your proxy settings](http://www.wikihow.com/Change-Proxy-Settings) from your browser’s settings panel.

## Using Proxy with Git

Once you have obtained the proxy settings (server URL, port, username and password); you need to configure your git as follows:

```bash
$ git config --global http.proxy http://<username>:<password>@<proxy-server-url>:<port>

```

You would need to replace `<username>`, `<password>`, `<proxy-server-url>`, `<port>` with the values specific to your proxy server credentials. These fields are optional. For instance, your proxy server might not even require `<username>` and `<password>`, or that it might be running on port 80 (in which case `<port>` is not required).

Once you have set these, your `git pull`, `git push` or even `git fetch` would work properly.

## When Not to Use

You should not have to use `git` commands with proxy settings, if either of the following happens

- Your system administrator or corporate policy does not allow you to access remote `git` repositories from GitHub, BitBucket etc.
- The remote repository in question is not in your machine, but it’s within the internal network. An instance of GitLab deployed internally at your company is a good example.

## Unset Proxy Settings

Use [this](http://stackoverflow.com/questions/11499805/git-http-proxy-setting) Stack Overflow discussion to unset your proxy settings.

---

<div class="post-metadata">

**Author:** ![JorgeAlba](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jorgealba/32/165875_2.png) [@JorgeAlba](https://forum.freecodecamp.org/u/JorgeAlba)\
**Post date:** [June 22, 2016, 9:23pm UTC](https://forum.freecodecamp.org/t/git-behind-a-proxy-server-how-to-modify-your-git-commands-for-proxies/13187/2 "2016-06-22T21:23:30Z")

</div>

Why don’t you use a proxy server like Hidester that do it all this configurations for you. It is completely free and it is very reliable. [https://hidester.com/proxy/](https://hidester.com/proxy/)

---

<div class="post-metadata">

**Author:** ![kevcomedia](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/kevcomedia/32/125737_2.png) [@kevcomedia](https://forum.freecodecamp.org/u/kevcomedia)\
**Post date:** [August 7, 2017, 1:47am UTC](https://forum.freecodecamp.org/t/git-behind-a-proxy-server-how-to-modify-your-git-commands-for-proxies/13187/3 "2017-08-07T01:47:11Z")

</div>


