ubuntu Git升级

来源:互联网 发布:python ipython 编辑:程序博客网 时间:2024/05/20 04:10

最近在使用git提交代码:git push origin master的时候报错:

The requested URL returned error: 401 Unauthorized while accessing https://gitee.com/hgdq/项目名字.git/info/refs

后来百度发现时服务器上面安装的git版本过低。
原文地址:http://www.cnblogs.com/kaituorensheng/p/5491601.html
1. 下载:# wget -O git.zip https://github.com/git/git/archive/master.zip

  1. 解压:# unzip git.zip

  2. 进入git目录:# cd git-master

  3. 编译安装:

autoconf./configure --prefix=/usr/localmake && make install
  1. 最后别忘了删掉旧的git,并把新版本的git建立软链接到/usr/bin/git
rm /usr/bin/gitln -s /usr/local/bin/git /usr/bin/git