Ask Your Question
2

How to update Git version on Fedora?

asked 2014-08-11 10:47:40 -0500

Fernando Paladini gravatar image

updated 2014-08-11 11:48:21 -0500

mether gravatar image

Hello people!

I'm a new Fedora user (currently using Fedora 20) and I'm developer too. Currently I have Git 1.9.3 in my Fedora, but I want update it to 2.0.4, how can I do that?

Recently I run sudo yum upgrade, but Git isn't updated. Can you help me?

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
2

answered 2014-08-11 11:09:22 -0500

NickTux gravatar image

updated 2014-08-14 16:19:30 -0500

Right now, the version you are looking for, is available at rawhide repository only. Rawhide is a special repository for testing proposes only. It is not recommended for production systems, but is intended for testing packages for bugs and problems, before they pushed to the stable release. Read more about rawhide here.

Now, you can use a "trick" and install this package only, from rawhide repository. Do not install any other package, and be aware to not upgrade the whole system from rawhide, because you will end up with a completely testing and unstable system.

If you follow the instructions below, I think you will be ok.

sudo yum install fedora-release-rawhide

above command will install the approrpiate repo files, but it will not enable the repository (so you are safe).

Now you can do

sudo yum install git --enablerepo=rawhide

above command will enable the rawhide repository once, and it will install the git package (and all its dependencies) from the rawhide repository. After this action, the repository will remain disabled (and you are safe again).

If you encountering errors during the installation, try again later, because rawhide repositories are not very stable, mirrors can get corrupted, but after a while are back again.

edit flag offensive delete link more

Comments

2

I would not suggest cherry picking packages from rawhide. While it may work, if it doesn't, debugging it will be really difficult. Rawhide packages are built as a set, to work well with each other. Using them with Fedora 20 packages might result in unexpected behaviour.

FranciscoD_ gravatar imageFranciscoD_ ( 2014-08-14 01:32:33 -0500 )edit

That is so, very, very true. I didn't even think about that!

abadrinath gravatar imageabadrinath ( 2014-08-14 02:41:56 -0500 )edit

Picking specific packages when they don't have lot of dependencies, I think it's ok. This specific package (git) has very few dependencies (only git-perl if I remember correctly) and apparently this is a workaround to OP' s demand on how to install and use the Git 2.0.4 version.

NickTux gravatar imageNickTux ( 2014-08-14 08:40:38 -0500 )edit
2

The problem happens when users take a look at answers in such questions and try to pull in say the latest gcc from rawhide or something and end up breaking their systems. So it is often helpful to add an explicit warning that this is generally not recommended and one should look at copr repositories or other solutions for getting latest packages that are not part of the default updates repository

mether gravatar imagemether ( 2014-08-14 09:57:16 -0500 )edit

I have the warning already, but I suppose it needs a little bit bold :)

NickTux gravatar imageNickTux ( 2014-08-14 16:18:37 -0500 )edit
0

answered 2014-08-14 18:58:09 -0500

baoboa gravatar image

updated 2014-08-14 19:00:58 -0500

I see two other way to do it

1) the ugly

CHROOT=/home/chroot
yum install git --releasever=21 --disablerepo "rpmfusion*" --installroot=$CHROOT --nogpgcheck
alias git=$CHROOT/usr/bin/git
git --version

350Mo just for git is a little bit an overkill.

or

2) the bad

#grab it from koji 
 wget https://kojipkgs.fedoraproject.org//packages/git/2.0.4/1.fc21/src/git-2.0.4-1.fc21.src.rpm
 yum-builddep ./git-2.0.4-1.fc21.src.rpm
 rpmbuild --rebuild git-2.0.4-1.fc21.src.rpm
 yum localinstall ~/rpmbuild/RPMS/x86_64/git-2.0.4-1.fc20.x86_64.rpm ~/rpmbuild/RPMS/noarch/perl-Git-2.0.4-1.fc20.noarch.rpm

it's bad because it make the system unstable like the previous answer.

maybe it's just easier to compile it from source. "yum-builddep git" can help in this case.

edit flag offensive delete link more

Comments

it's bad because it make the system unstable like the previous answer. No, it isn't.

You are installing the build dependencies from you current release - that does not make your system unstable. Then you are fetching the source RPM and compile it to binary form using dependencies already available on your system. The only, so called unstable, component you have it the freshly installed git. And it does not mind if it's from the src.rpm or from downloaded git source.

ArturFH gravatar imageArturFH ( 2015-05-19 07:50:00 -0500 )edit

a lot of applications are using git , if there is a api change for example it can break an app depending on git , or it will make you unable to install some package with a fix dependency on some version of git.

baoboa gravatar imagebaoboa ( 2015-05-19 15:56:32 -0500 )edit
0

answered 2014-08-14 01:36:05 -0500

FranciscoD_ gravatar image

The short answer here is, that you cannot use this version with Fedora 20 unless you build it yourself. The maintainers probably haven't updated it because of the Fedora updates policy where we don't do major version updates in stable releases - http://fedoraproject.org/wiki/Updates_Policy . If you think this package should be updated, please file a bug and ask the maintainers to update it - https://apps.fedoraproject.org/packages/git/bugs/all .

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-08-11 10:47:40 -0500

Seen: 4,243 times

Last updated: Aug 14 '14