This document explains how to obtain the Git Credential Manager for Mac and Linux (GCM4ML) and how to configure Git to use the GCM4ML as its credential helper.
Great care was taken to avoid using any features of Java that would impact compatibility with Java 6. If you find a compatibility issue, please report it and provide as many details about your platform as necessary to reproduce the problem.
- Mac OS X version 10.9.5 and up OR a recent GNU/Linux distribution.
- Java 6 and up.
- Git version 1.9 and up.
On Mac OS X, installing via Homebrew is highly recommended. On Linux, it is recommended to use Linuxbrew or an RPM-based package manager if you can.
If you can't use any of the package managers, you can also download git-credential-manager-2.0.4.jar somewhere safe and stable, such as ~/git-credential-manager/
, and then follow the instructions for automatic or manual configuration.
-
Update the Homebrew/Linuxbrew formulae to make sure you have the latest versions:
brew update
-
Install the GCM4ML formula:
brew install git-credential-manager
-
Run the GCM4ML in
install
mode, which will check its requirements and then update the "global" Git configuration file (the one in your home folder):git-credential-manager install
-
Download git-credential-manager-2.0.4-1.noarch.rpm and copy the file somewhere locally.
-
Download the PGP key used to sign the RPM.
-
Import the signing key into RPM's database:
sudo rpm --import RPM-GPG-KEY.txt
-
Verify the GCM4ML RPM:
rpm --checksig --verbose git-credential-manager-2.0.4-1.noarch.rpm
...you should see a line (among those there) that is equal to the following:
V4 RSA/SHA256 Signature, key ID ba34dbc2: OK
-
Install the RPM:
sudo rpm --install git-credential-manager-2.0.4-1.noarch.rpm
-
Run the GCM4ML in
install
mode, which will check its requirements and then update the "global" Git configuration file (the one in your home folder):git-credential-manager install
Download git-credential-manager-2.0.4.jar somewhere safe and stable, such as ~/git-credential-manager/
-
Run the GCM4ML in
install
mode, which will check its requirements and then update the "global" Git configuration file (the one in your home folder):java -jar /home/example/git-credential-manager/git-credential-manager-2.0.4.jar install
-
Configure the
credential.helper
setting to launch Java with the absolute path to the JAR (make sure you surround the whole value with 'single quotes'):git config --global credential.helper '!java -Ddebug=false -Djava.net.useSystemProxies=true -jar /home/example/git-credential-manager/git-credential-manager-2.0.4.jar'
Debug mode will turn on tracing and assertions, producing a lot of output to stderr
. Only turn this on temporarily, when trying to isolate a defect.
-
Run the GCM4ML in
install
mode with thedebug
property set totrue
(orfalse
to disable):java -Ddebug=true -jar /home/example/git-credential-manager/git-credential-manager-2.0.4.jar install
-
Retrieve the value of the
credential.helper
configuration:git config --global --get credential.helper git-credential-manager
...it should look like this:
!java -Ddebug=false -Djava.net.useSystemProxies=true -jar /home/example/git-credential-manager/git-credential-manager-2.0.4.jar
-
Set a new value for the
credential.helper
configuration (essentially repeating the manual configuration installation step, being careful with quoting and spaces), changing the value of thedebug
property totrue
(orfalse
to disable).
If your network does not allow a direct connection to remote hosts, you can configure the GCM4ML to perform requests through a web proxy.
If you are running Gnome 2.x or greater, you can configure the proxy settings using the GUI and the GCM4ML will use those settings thanks to a JVM feature that's activated by setting the java.net.useSystemProxies
system property to true
(this is now done automatically when running the GCM4ML in install
mode).
If it's not possible to use the automatic proxy server configuration, you must set the appropriate networking properties. Aside from SOCKS proxy servers, which can have their credentials specified through specific properties, authenticated proxy servers are currently not supported.
-
Retrieve the value of the
credential.helper
configuration:git config --global --get credential.helper git-credential-manager
...it should look like this:
!java -Ddebug=false -Djava.net.useSystemProxies=true -jar /home/example/git-credential-manager/git-credential-manager-2.0.4.jar
-
Set a new value for the
credential.helper
configuration (essentially repeating the manual configuration installation step, being careful with quoting and spaces), adding the appropriate properties. For example, if you have a proxy server that can do HTTP and HTTPS, running on the host192.168.0.117
, listening on port8123
, then you would run the following (notice there's a pair of properties for http and one for https).git config --global credential.helper '!java -Ddebug=false -Dhttp.proxyHost=192.168.0.117 -Dhttp.proxyPort=8123 -Dhttps.proxyHost=192.168.0.117 -Dhttps.proxyPort=8123 -jar /home/example/git-credential-manager/git-credential-manager-2.0.4.jar'
We are sad to see you go! Please give us some feedback on how we could do better next time.
-
Run the GCM4ML in
uninstall
mode, which will update the "global" Git configuration file (the one in your home folder):git-credential-manager uninstall
-
Uninstall the git-credential-manager package with Homebrew/Linuxbrew:
brew uninstall git-credential-manager
-
Archive the
insecureStore.xml
file from thegit-credential-manager
sub-folder under your HOME folder.
-
Run the GCM4ML in
uninstall
mode, which will update the "global" Git configuration file (the one in your home folder):git-credential-manager uninstall
-
Uninstall the git-credential-manager package with RPM:
sudo rpm --erase git-credential-manager-2.0.4-1.noarch
-
Archive the
insecureStore.xml
file from thegit-credential-manager
sub-folder under your HOME folder.
-
Retrieve the value of the
credential.helper
configuration:git config --global --get credential.helper git-credential-manager
-
Run the GCM4ML in
uninstall
mode, which will update the "global" Git configuration file (the one in your home folder):java -jar /home/example/git-credential-manager/git-credential-manager-2.0.4.jar uninstall
-
The value retrieved in step 1 contained the path to the JAR. You can go delete that JAR.
-
Archive the
insecureStore.xml
file from thegit-credential-manager
sub-folder under your HOME folder.
-
Retrieve the value of the
credential.helper
configuration:git config --global --get credential.helper git-credential-manager
-
Delete the value of the
credential.helper
configuration:git config --global --unset credential.helper git-credential-manager
-
The value retrieved in step 1 contained the path to the JAR. You can go delete that JAR.
-
Archive the
insecureStore.xml
file from thegit-credential-manager
sub-folder under your HOME folder.