我所有的git命令什么都不做 [英] all of my git commands do nothing

查看:123
本文介绍了我所有的git命令什么都不做的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Mac OS X上设置git。我运行安装程序,一切似乎都很顺利,但现在它的表现非常奇怪。输入任何以 git 开头的命令都不会做任何事情,除非在shell中显示空行;再次按下输入然后给我一个新的命令提示符。这就是我的意思:

  wireless-224-128:〜$ git init 

wireless-224 -128:〜$ git config --global user.nameMy Name

wireless-224-128:〜$ git config --global user.emailmy_email@gmail.com

wireless-224-128:〜$ cd first_git /
wireless-224-128:first_git $ git init

wireless-224-128:first_git $

所有这些空行都是程序在那里无所事事的地方(至少,我看不到任何东西)。再次按下输入,我会回到提示符。



这是怎么回事?顺便说一句,在我安装git osx keychain之后,行为似乎改变了 - 在设置之前,我运行的唯一git命令是调用配置我的用户名和电子邮件的调用,但它们似乎工作正常。我不确定钥匙串是否以某种方式搞乱了我的系统。任何想法?



更新:

向后。我试图删除并重新安装git。现在看来,我有一个工作版本的git,因为如果我运行 / usr / local / git / bin / git --version ,它会正确响应。但是,如果我键入 git --version ,它会告诉我 -bash:/ usr / bin / git:没有这样的文件或目录。然而,在/ usr / bin / git中,我确实有一个名为 git 的文件,以及其他几个以git开头的文件。这是什么?



进一步更新:

我能够得到它工作(至少,据我所知)。我所做的是在下面的答案中详细说明的,而且对于经验丰富的unix专业人员来说可能是绰绰有余的。感谢您的帮助。

解决方案

好的,我不确定发生了什么,但我认为我可能意外地覆盖了文件或以其他方式损坏我的安装。最终修复它的是运行该软件包中包含的 uninstall.h 脚本,删除 / usr / bin中所有与git相关的二进制文件,重新安装软件包,然后然后退出并重新启动终端。如果没有做最后一步,终端将继续在/ usr / bin中查找文件,即使在重新安装后。



感谢您的帮助人员。事实证明,我认为它只是简单的用户错误/ unix相关的愚蠢行为。 :)

I'm trying to set up git on Mac OS X. I ran the install and everything seemed to be fine, but now it's acting very strangely. Typing any command that begins with git does nothing except show me an empty line in my shell; pressing Enter a second time then just gives me a new command prompt. Here's what I mean:

wireless-224-128:~ $ git init

wireless-224-128:~ $ git config --global user.name "My Name"

wireless-224-128:~ $ git config --global user.email "my_email@gmail.com"

wireless-224-128:~ $ cd first_git/
wireless-224-128:first_git $ git init

wireless-224-128:first_git $ 

All of those empty lines are places where the program just sits there doing nothing (at least, nothing that I can see). Pressing Enter a second time sends me back to the prompt as I said.

What's going on here? By the way, the behavior seemed to change after I installed the git osx keychain -- well, the only git commands I had run prior to setting that up were the calls to configure my username and email, but they seemed to work. I'm not sure if the keychain has messed up my system in some way. Any ideas?

UPDATE:

I've gone a bit forwards and backwards. I attempted to remove and reinstall git. Now it seems that I have a working version of git, in that if I run /usr/local/git/bin/git --version it responds correctly. However, if I type git --version, it tells me -bash: /usr/bin/git: No such file or directory. However, looking in /usr/bin/git, I DO in fact have a file named git, and several other files that start with git. What the hell?

FURTHER UPDATE:

I was able to get it to work (at least, as far as I can tell). What I did is detailed in my answer below, and is probably groan-worthy to seasoned unix pros. Thanks for all the help.

解决方案

Alright, I'm not sure exactly what happened, but I think I probably accidentally overwrote a file or otherwise corrupted my installation. What ended up fixing it was running the uninstall.h script included with the package, deleting all of the git-related binaries in /usr/bin, reinstalling the package, and then quitting and restarting the terminal. Without doing the last step, the terminal would keep looking for files in /usr/bin, even after reinstalling.

Thanks for all of your help guys. As it turns out, I think it just came down to simple user error/unix-related silliness. :)

这篇关于我所有的git命令什么都不做的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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