1

Every operation i try to do on my server related to git gives me this error

error: The requested URL returned error: 401 while accessing https://xxxx.org/proj/proj.git/info/refs

fatal: HTTP request failed

So researching a bit i thought of updating my git. Currently my git version is 1.7.1 But the problem is i can't find a proper way to update my git version on my centos 6.8

I referred this link but did not try it as the anwers are very old and rpmforge repo is not updated since a long time. Everything else seems not so promising.

A similar question to mine is this but unfortunately there is no solution in it and leads me to same link i shared.

Will updating the git solve my problem? If yes the what is the right way to update git?If no then how to solve that error?

Community
  • 1
  • 1
node_saini
  • 727
  • 1
  • 6
  • 22
  • for git update try to follow the steps in the link : https://tecadmin.net/install-git-2-0-on-centos-rhel-fedora/# and change the git version – Venom Mar 21 '17 at 10:07
  • About updating when you don't have install privileges : You could just `git clone` git itself with the /usr/lib/git of version 1.7.1. Build it with `--prefix=$HOME`, install it and add $HOME/bin in the head of your PATH variable. This is what I've done here :-) Here the 1.7.1 works quite well. So my guess is the problem is not on the version. Is this not a proxy problem ? – Laurent G Mar 21 '17 at 10:07
  • @basslo `echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc` gives me a error `-bash: /etc/bashrc: Permission denied` how to solve this? – node_saini Mar 21 '17 at 10:53
  • @LaurentG I am not sure about it. But i tried doing `git clone` in my directory and it still gave me that error. – node_saini Mar 21 '17 at 10:55
  • i didn't put it on /usr/local but $HOME since i don't have rights on /user/local – Venom Mar 21 '17 at 10:57
  • Uh uh. 401 is privilege problem. Did you give any "secret" to git in order to give him access to the remote repo ? – Laurent G Mar 21 '17 at 10:59
  • Can you verify the install put anything in $HOME/bin called git _something_ ? – Laurent G Mar 21 '17 at 11:00
  • i explicitly gave permissions to `/etc/bashrc` and installed the latest of git version 2.0.5 but now when i return back and run the git pull command i get `error: cannot open .git/FETCH_HEAD: Permission denied` and if i use sudo then `sudo: git: command not found` – node_saini Mar 21 '17 at 11:20
  • I have put it in /usr/local instead of $HOME so when i run `which git` it gives me `/usr/local/git/bin/git` – node_saini Mar 21 '17 at 11:23

0 Answers0