问题: 本地服务器clone代码的时候发现error: The requested URL returned error: 501。
一般是由于git版本的问题。 使用如下指令查看版本: git --version git version 1.7.1
升级git版本:
首先卸载旧版本git
yum remove git
直接使用这个命令下载的还是1.7.1版本的。不使用源码进行编译是因为依赖太多,总会缺东西。
yum install git
可以使用 WANDisco's CentOS repository去安装 Git 2.x.
Install WANDisco repo package:
yum install http://opensource.wandisco.com/centos/6/git/x86_64/wandisco-git-release-6-1.noarch.rpm
Install the latest version of Git 2.x:
yum install git
如果再bower时出现SSL connect error,执行 git config --global http.sslversion tlsv1
安装成功后,就可以执行clone命令了, 执行报错处理: git的使用错误unable to read askpass git push -u origin master (gnome-ssh-askpass:3916): Gtk-WARNING **: cannot open display: error: unable to read askpass response from '/usr/libexec/openssh/gnome-ssh-askpass' Username for 'https://github.com': 5dddd6@qq.com (gnome-ssh-askpass:3917): Gtk-WARNING **: cannot open display: error: unable to read askpass response from '/usr/libexec/openssh/gnome-ssh-askpass' Password for 'https://574482856@qq.com@github.com': Counting objects: 32, done. 根本原因: [song@localhost ltdata]$ cat /etc/profile.d/gnome-ssh-askpass.sh SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass export SSH_ASKPASS
解决办法: unset SSH_ASKPASS
==== 由于本地代码和服务器代码不一致,导致jenkins发布不成功,骚操作 ,直接shell去拉代码build:
#!/bin/bash
CONID='jenkins' CONKEY='123456'
cd /data/www/bdd/bamp_ui unset SSH_ASKPASS #git clone http://bitbucket.xef.com/scm_ui.git expect -c "spawn git pull origin; expect "Username" { send "${CONID}\n"; exp_continue } "Password" { send "${CONKEY}\n" }; interact" git checkout dev rm -rf dist npm install npm run build exit 0