【问题标题】:Git push error in localhost本地主机中的 Git 推送错误
【发布时间】:2013-02-18 12:25:47
【问题描述】:

您好,我从事过一个项目,现在我想将我的代码推送到本地 git repo,我已经推送代码或更改了几次,没有任何错误,但是今天我发出命令。从我的 Linux 操作系统 ubuntu

 git push origin develop

我收到以下错误

Connection closed by ::1
fatal: The remote end hung up unexpectedly

这是关于我的 git 配置的信息

git config --list
alias.l=log --pretty=oneline -n 20 --graph
alias.s=status -s
alias.d=diff --patch-with-stat
alias.p=!git pull; git submodule foreach git pull origin master
alias.c=clone --recursive
alias.ca=!git add -A && git commit -av
alias.go=checkout -B
alias.tags=tag -l
alias.branches=branch -a
alias.remotes=remote -v
alias.credit=!f() { git commit --amend --author "$1 <$2>" -C HEAD; }; f
alias.reb=!r() { git rebase -i HEAD~$1; }; r
alias.undopush=push -f origin HEAD^:master
apply.whitespace=fix
core.excludesfile=~/.gitignore
core.attributesfile=~/.gitattributes
core.whitespace=space-before-tab,indent-with-non-tab,trailing-space
core.autocrlf=input
core.editor=vi
color.ui=auto
color.branch.current=yellow reverse
color.branch.local=yellow
color.branch.remote=green
color.diff.meta=yellow bold
color.diff.frag=magenta bold
color.diff.old=red bold
color.diff.new=green bold
color.status.added=yellow
color.status.changed=green
color.status.untracked=cyan
merge.log=true
branch.master.remote=origin
branch.master.merge=refs/heads/master
url.git@github.com:.insteadof=gh:
url.git@github.com:.pushinsteadof=github:
url.git@github.com:.pushinsteadof=git://github.com/
url.git://github.com/.insteadof=github:
url.git@gist.github.com:.insteadof=gst:
url.git@gist.github.com:.pushinsteadof=gist:
url.git@gist.github.com:.pushinsteadof=git://gist.github.com/
url.git://gist.github.com/.insteadof=gist:
user.name=Pradeep Rajvanshi
user.email=pradeep@gsmicrosystems.com
github.user=username
github.token=0123456789yourf0123456789token
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=git@localhost:lms.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*

请指导我。谢谢。

【问题讨论】:

  • 我在linux操作系统-ubuntu
  • 也许,你的并发连接太多了。请在您的终端中尝试此/etc/init.d/sshd restart,然后再次推送。
  • 当我输入这个命令 /etc/init.d/sshd restart 我得到 bash: /etc/init.d/sshd: No such file or directory

标签: git push


【解决方案1】:

您的 origin 远程在您的本地计算机上设置为 ssh 访问,显然没有运行 ssh 守护程序。如果您想推送到本地存储库(为什么要这样做?),您可以在不使用 ssh 的情况下执行此操作,只需将远程设置为直接指向您的本地文件系统。

【讨论】:

  • 我使用 ssh 将代码提交到远程在线服务器,但这完全是一个不同的项目。
  • 你的配置是remote.origin.url=git@localhost:lms.git。这是当您执行git push origin 时它尝试连接的地方。
猜你喜欢
  • 2014-11-13
  • 2021-08-07
  • 2018-01-28
  • 2017-03-08
  • 1970-01-01
  • 2016-07-29
  • 1970-01-01
  • 1970-01-01
  • 2016-08-10
相关资源
最近更新 更多