Where do I configure the proxy settings for GIT in IntelliJ Idea? I've gotten the proxy settings working for the plugins, but I just can't find it for GIT; and the help files only mention subversion.
Any help is appreciated.
Setting the proxy for Git Run the following commands replacing USERNAME , PASSWORD , PROXY_ADDRESS , and PROXY_PORT with your network's information: git config --global --add http. proxy http://USERNAME:PASSWORD@PROXY_ADDRESS:PROXY_PORT. git config --global --add https.
Associate the entire project with a single Git repository Alternatively, from the main menu, select VCS | Enable Version Control Integration. Choose Git as the version control system and click OK. After VCS integration is enabled, IntelliJ IDEA will ask you whether you want to share project settings files via VCS.
Configure proxy settings directly from IntelliJ IDEA. Do the following: Open the Version Control | Subversion | Network page of the IDE settings Ctrl+Alt+S . Click the Edit Network Options button and specify the proxy settings in the Edit Subversion Options Related to Network Layers dialog that opens.
Do one of the following: To push changes from the current branch press Ctrl+Shift+K or choose Git | Push from the main menu. To push changes from any local branch that has a remote, select this branch in the Branches popup and choose Push from the list of actions.
You have to configure proxy for git and not for intelliJ, intelliJ will just call the git command line.
git config --global http.proxy yourProxy:port
should do it.
To be complete I would like to add how to hop over a proxy to get to git server or secured sites using ssh, like for example private github repositories.
For intellij when using this option, you must select to use the native ssh implementation in Project Settings --> Version Control --> VCSs --> Git --> SSH Executable
We use a tool called corkscrew. This is available for both CygWin (through setup from the cygwin homepage) and Linux using your favorite packaging tool.
For MacOSX I refer to this blogpost to install it on you Mac.
The command line is as follows :
corkscrew <proxyhost> <proxyport> <targethost> <targetport> <authfile>
The proxyhost and proxyport are the coordinates of the https proxy.
The targethost and targetport is the location of the host to tunnel to.
The authfile is a textfile with 1 line containing your proxy server username/password separated by a colon
e.g:
abc:very_secret
Installation for using git:// protocol : usually not needed!
Create a script ~/bin/gitproxy which contains :
#!/bin/bash
corkscrew proxy.colo.elex.be 3128 github.com 9148 ~/.ssh/proxy_auth
Make sure it is safe from prying eyes.
Set an environment variable to define the proxy command for git
$ export GIT_PROXY_COMMAND=/home/pti/bin/gitproxy
You might place this in a section or script sourced from .bashrc which dynamically detects if you are behind the proxy or not. If the variable is not defined then git will work as usual.
Installation for using "normal" ssh protocol for git communication By adding this to the ~/.ssh/config this trick can be used for normal ssh connections
Host gitproxy HostName github.com Port 22 ProxyCommand corkscrew %h %p ~/.ssh/proxy_auth
enjoy!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With