我试图设置git与http://danielmiessler.com/study/git/#website来管理我的网站。
我已经到了指令的最后一步:git push website +master:refs/heads/master
我正在win7中使用git ming32命令行工作
$ git push website +master:refs/heads/master
Bill@***.com's password:
Connection closed by 198.91.80.3
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
这里的一个问题可能是程序正在寻找bill@* **.com。当我通过ssh连接到我的网站,我有一个不同的用户名(让我们说'abc')。也许这个应该是abc@***。com。如果是这样,我不知道如何改变这一点,或者如果我可以推下一个别名
我间歇性地遇到这个问题,大多数时候它不会给出错误消息。对我来说,解决方案是在我的LDAP服务器的IP地址改变之后正确地配置LDAP。
的/etc/gitlab/gitlab.LDAP的rb配置指向一个不存在的IP地址,因此更改主机以指向LDAP服务器的正确主机名解决了这个问题。
要诊断问题,使用gitlab-ctl tail命令来帮助您找到堆栈跟踪。对我来说,我找到了这个stacktrace:
==> /var/log/gitlab/gitlab-rails/production.log <==
Net::LDAP::Error (No route to host - connect(2) for 10.10.10.12:389):
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/net-ldap-0.16.0/lib/net/ldap/connection.rb:72:in `open_connection'
...
修改/etc/gitlab/gitlab.rb中的主机值
gitlab_rails['ldap_servers'] = YAML.load <<-'EOS'
main:
label: 'My LDAP'
# this was an IP address
# host: '10.10.10.12'
host: 'internal-ldap-server' # this is the fix
port: 389
在更改上面的配置文件之后,一定要重新配置gitlab
gitlab-ctl reconfigure
我也犯了同样的错误,这让我得到了这个没有帮助的答案。
我试图创建一个新的“裸”存储库,第一次使用以下命令跟踪到NTFS位置:
cd myrepository
git init --bare \\myserver.mycompany.local\myrepository.git
git init
git status
git add .
git status
git commit -m "Initial Commit"
git remote add origin \\myserver.mycompany.local\myrepository.git
git push -u origin master
git status
我的问题原来是在NTFS位置中使用后斜杠而不是前斜杠,当试图添加原点来设置(新的)跟踪上游分支时。
我必须删除原点使用:
git remote rm origin
然后使用预期的正斜杠再次添加原点
git remote add origin //myserver.mycompany.local/myrepository.git
希望这对将来的人有所帮助。