git - 为什么 git 挂起 - 必须在命令后按 enter 两次?

标签 git github terminal

编辑:摘要:在 Git 中输入的每个命令都会产生一个悬挂的光标,如果在按下回车键之前输入任何内容,该光标就会显示“输入错误”。没有命令产生任何结果。我尝试了全新安装但没有结果。

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

我遵循了网站上的基本说明:

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

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

我真的不明白这里发生了什么,我不确定是否有问题。

编辑:

Git 是从主下载页面安装的。

http://git-scm.com/downloads

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

我试过重新安装,但没有用。我尝试了其他 git 命令,例如 git config --global user.name "Meeeee" 但没关系。它们都产生相同的悬挂。

最佳答案

考虑到您使用的是 OS X,并且在 Keith Thompson 之后的 comment ,这是可能的

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.

  • 或者你安装了多个 git:

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 - 为什么 git 挂起 - 必须在命令后按 enter 两次?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12700047/

相关文章:

regex - Linux 终端中整个目录的正则表达式搜索和替换

Git Publisher "target remote name"验证问题,单一 repo

git - 如何在特定提交中获取重命名文件的修改信息?

Git fetch 给出 "cannot lock ref"错误消息,但似乎仍然有效

android - 在 Android 上通过蓝牙连接多个设备(多个 BLE 连接)

python - 在 Mac 上使用终端安装 NLTK for Python 3.3

git - 如何使用android studio更改git存储库

github - 如何更改我的个人资料 "language"(个人资料图片下 <> 旁边的部分)

git - 如何将文件从 GitHub 移动到 Web 服务器

linux - 从 vpnbook.com 自动化 VPN 的 Bash 脚本