为什么git挂起 - 必须在命令后按两次输入? [英] Why is git hanging - have to press enter twice after commands?

查看:137
本文介绍了为什么git挂起 - 必须在命令后按两次输入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编辑:摘要:在Git中输入的每个命令都会产生一个悬挂的光标,如果在按下Enter之前输入了任何内容,则会显示bad input。没有命令会产生任何结果。我尝试了新的安装方式,但没有任何结果。



我完全 Git。不知道我在做什么。 (我在Mac上)



我遵循网站上的基本指示:

  touch README.md 
git init
git add README.md
git commit -m第一次提交
git remote add origin git @ github。 com:aerovistae / MetPetDB-Mobile.git
git push -u origin master

但as一旦我输入git init,终端就会挂起。我按下回车键,没有任何反应,提示符不会开始新行......它只是开始一个没有闪烁光标的空白行。我再次按下输入按钮,提示返回,在终端上跳过一行,现在正在等待我的下一个命令。



我不太明白发生了什么事在这里,我不知道是否有什么不对。



编辑:



Git已安装从主下载页面。



http:// git- scm.com/downloads



在我输入 git init 后,我得到闪烁的光标一个空白的新行,过了一会儿,我犹豫地输入了 Testing ,然后再次输入。然后,它在下一行中吐出 bad input:Testing 并向我显示新的提示。



I试图重新安装,但无济于事。我尝试其他的git命令,比如 git config --global user.nameMeeeee但是没关系。它们都产生相同的挂起。 解决方案

考虑到你在OS X上,并且在凯斯汤普森评论,这是可能的




您已将别名混入其他名称(可能 alias git =git credential-osxkeychain),并且您应该查看〜.profile 以查看是否可以删除别名。





  • 或者你有几个l git installed:




看起来您安装了 git-credential- osxkeychain 包装在错误的地方(你是否 cp 到 / usr / bin / git 而不是 / usr / local / git / bin ?)

要修复,您只需要删除 / usr / bin中/ GIT中;假设git仍安装在 / usr / local / bin 中,它应该接管。



它实际安装到 / usr / local / git / bin 所以我只是将它添加到我的 PATH 中。



Edit: Summary: Every command entered in Git produces a hanging cursor which then says "bad input" if anything is typed before enter is pressed. No commands produce any results. I tried a fresh install with no results.

I am completely new to Git. No idea what I'm doing whatsoever. (I'm on a Mac)

I was following the basic instructions on the site:

touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:aerovistae/MetPetDB-Mobile.git
git push -u origin master

But as soon as I type in "git init", the terminal hangs. I press enter, nothing happens, the prompt doesn't start a new line...it just starts a blank line with no blinking cursor. I press enter a second time, the prompt returns, having skipped a line in the terminal, and now waiting for my next command.

I don't really understand what's going on here, and I'm not sure if something's wrong or not.

EDIT:

Git was installed from the main downloads page.

http://git-scm.com/downloads

After I hit enter on git init I get the blinking cursor on a blank new line, and after a moment I hesitantly typed in Testing and hit enter again. It then spat out, on the next line, bad input: Testing and showed me a new prompt.

I tried reinstalling, but to no avail. I try other git commands, like git config --global user.name "Meeeee" But it doesn't matter. They all produce the same hanging.

解决方案

Considering you are on OS X, and after Keith Thompson's comment, it is possible

you've aliased git to something else (probably alias git="git credential-osxkeychain"), and you should look in ~.profile to see if you can remove the alias.

  • or you have several git installed:

It looks like you installed the git-credential-osxkeychain wrapper in the wrong place (did you cp to /usr/bin/git instead of /usr/local/git/bin?)
To fix, you'll want to just delete /usr/bin/git; assuming git is still installed in /usr/local/bin it should take over.

It's actually installed to /usr/local/git/bin so I just added that to my PATH.

这篇关于为什么git挂起 - 必须在命令后按两次输入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆