I am trying to get my IDE set up at work for a project I am working on. I am coding in python and working in PyCharm because of its awesome git support. However, whenever I try to configure git on PyCharm to clone my project, it tells me that my version of git , 18.104.22.168, is too old and needs to be updated to at least 22.214.171.124. I have searched around dozens of times and have only ever found solutions that require root access to achieve. Is there any simple way to update git on this machine?
Compile it and then install it locally. - Step-by-step:
- go to https://github.com/git/git and download the zip file. Extract it to a convenient place and cd into it.
If you are fine with git installing to ~/bin, you can skip 2 and 3 (source)
./configure --prefix=/some/absolut/path/to/your/private/binwhere the path can be eg.: /home/YOUR_USERNAME/.local - make sure the directory exists!
make && make install
- prefix ~/.bin to your $PATH environment variable, ie.:
export PATH="~/bin:$PATH"in case you did not use configure to change the defaults.
- you should now be able to run 'git'.
export PATH="~/YOURFOLDER:$PATH" statement to your ~/.profile (if not existant, create it and paste the line into it) so PATH is set each time you login.
More on this in the INSTALL file in the downloaded git source.
Assuming you have the necessary C development tools installed, you can compile your own version of git from sources, and install it in $HOME/bin/ then ensure that's at the front of your PATH (assuming PyCharm just looks for git in your PATH).
This is still relevant, so based on my recent experience, I wanted to add some additional information to @larkey 's response above:
make && make installfails, run
yum install zlib-devel(or whatever your *nix distro uses to get the zlib packages installed)
make installcompleted, CentOS7 was still saying that 1.8.3 was the current version of git. I just moved the current git out of the way and created a symbolic link to the newly installed version:
cd /usr/bin sudo mv git git_126.96.36.199 sudo ln -s /home/<user name>/.local/bin/git git
Not the most elegant solution, but it worked and I could move on to more pressing issues. I suppose I could have used the alternatives install to fix this, but whatevs.