CentOS 编译安装git,解决github HTTPS 403错误
来源:互联网 发布:那个软件看寅唱会 编辑:程序博客网 时间:2024/06/06 18:26
CentOS 支持yum安装git:
yum install git
但克隆github仓库时:
git clone https://github.com/ironman/ironman.git
提示错误:
error: The requested URL returned error:403 Forbidden while accessing https://github.com/ironman/ironman.git/info/refs
查阅github文档:https://help.github.com/articles/https-cloning-errors
检查一下:
确定是由于git版本过低导致的,这样就需要从源码编译安装最新的git。
先安装一堆依赖包
yum installperl-ExtUtils-MakeMaker gettext-devel expat-devel curl-devel zlib-developenssl-devel openssl-devel gcc-c++ make
然后下载git source:
wget -Ogit-source.tar.gz https://api.github.com/repos/git/git/tarball/master
解压并安装:
tar zxvf git-source.tar.gz
mv git-git* gitsource
cd gitsource
make prefix=/usr install
出错了:
LINK git-credential-store
libgit.a(utf8.o): In function `reencode_string_iconv':
/home/chukong/gitsource/utf8.c:530: undefined reference to `libiconv'
libgit.a(utf8.o): In function `reencode_string_len':
/home/chukong/gitsource/utf8.c:569: undefined reference to `libiconv_open'
/home/chukong/gitsource/utf8.c:588: undefined reference to`libiconv_close'
/home/chukong/gitsource/utf8.c:582: undefined reference to `libiconv_open'
collect2: ld ?? 1
make: *** [git-credential-store] Error 1
链接时找不到libiconv。去官网下载一个:
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
解压,安装:
tar xzflibiconv-1.14.tar.gz
./configure--prefix=/soft/lib/libiconv-1.14
make
make install
回到gitsource目录:
make configure
./configure –-prefix=/usr/local --with-iconv=/soft/lib/libiconv-1.14
make
make install
此时,git已经编译安装成功
cd /usr/local/bin
./git –version
git version 1.8.5-rc3
卸载通过yum安装的git,
yum remove git
最后,编辑/etc/profile, 将/usr/local/bin加入到系统路径
exportPATH=$PATH:/usr/local/bin
保存退出,再刷新一下系统路径:
source /etc/profile
切换到工作目录,再执行
git –-version
如能正确显示版本,
git version 1.8.5-rc3
则大功告成
运行:
git clone https://github.com/ironman/ironman.git
输入帐号,密码
Cloning into 'ironman'...
Username for 'https://github.com':
Password for 'https://heliclei@github.com':
就可以从github仓库拉代码了:
remote: Counting objects: 17662, done.
remote: Compressing objects: 100% (7369/7369), done.
Receiving objects: 21% (3861/17662), 3.36 MiB | 31.00 KiB/s
[完]
- CentOS 编译安装git,解决github HTTPS 403错误
- CentOS 编译安装git,解决github HTTPS 403错误
- 安装GITHUB错误解决
- centos 编译 安装 git
- centos编译安装git
- centos 编译安装最新版 Git
- centos源码编译安装git
- git错误: The requested URL returned error: 403 Forbidden while accessing https://github.com/wangz/futu
- CentOS安装ice编译错误
- Git错误fatal: unable to access 'https://github.com/****.git/': Couldn't resolve host 'github.com'
- CentOS安装Oracle错误解决
- Centos安装ipvsadm错误解决
- 源码编译安装 PHP5.5.0,解决curl_exec访问HTTPS返回502错误的问题
- eclipse3.7 安装github插件错误解决
- centos源码编译安装最新版git
- CentOS下编译安装最新版Git
- svn编译安装错误解决
- Centos安装git和卸载git(编译安装)
- [MOOC学习笔记]机器学习基石 Lecture01 The Learning Problem
- asp.net 前台写JSON
- 什么是Python
- [Cocos2d-x]Android.mk中的LOCAL_SRC_FILES的终极技巧
- weka api调用小程序
- CentOS 编译安装git,解决github HTTPS 403错误
- HDU 3367
- POJ2528 海报问题(线段树+离散化)
- thinkphp中的import问题
- Linux C编程一站式学习笔记——第六章
- awk substr 左、右取字符
- Android一个Demo搞定所有控件
- ios unwind
- Android 扩大触摸的触发区域 TouchDelegate