为啥我看不到 git 命令的输出?
Posted
技术标签:
【中文标题】为啥我看不到 git 命令的输出?【英文标题】:Why cant i see the output of the git commands?为什么我看不到 git 命令的输出? 【发布时间】:2016-04-23 22:28:25 【问题描述】:我已经安装了 git。 我创建了一个新存储库,现在我想将一些文件添加到暂存中。 但是我在尝试这样做时遇到了格式和空白问题。 我现在需要运行这个命令:
$ git config --global core.autocrlf true
但是当我按下回车键时什么也没有发生。它只是将我返回到我试图从中运行此命令的目录。对我的行为完全没有反应。
当我运行这个命令时也会出现同样的问题:
$ git add -A
但是当我运行这个时:
$ git init
一切正常。
我该如何解决这个问题?
【问题讨论】:
【参考方案1】:没关系,
2 命令不打印任何回复。 :-)
对这些命令没有反馈。如您所见,这些命令没有提供任何反馈。
如果您想验证配置值是否已设置,请检查您的 .git/config
在您的情况下,由于您添加了--global
,因此配置条目将在您的~/.gitconfig
中。
要验证 git add
是否正常工作 - 使用 git status
查看已添加文件的列表。
List of help messages generated by GIT:
您可以通过配置打开/关闭它们:
# turn the detached message off
git config --global advice.<one of list below> false
advice.*
这些变量控制旨在帮助新用户的各种可选帮助消息。所有建议。* 变量默认为 true,您可以通过将这些设置为 false 来告诉 Git 您不需要帮助:
您可以在建议之后设置以下任何一项:
git config --global advice.<...>
pushUpdateRejected
Set this variable to false if you want to disable
pushNonFFCurrent,
pushNonFFMatching,
pushAlreadyExists,
pushFetchFirst, and
pushNeedsForce simultaneously.
pushNonFFCurrent
Advice shown when git-push(1) fails due to a non-fast-forward update
to the current branch.
pushNonFFMatching
Advice shown when you ran git-push(1) and pushed matching refs
explicitly (i.e. you used :, or specified a refspec that isn’t your
current branch) and it resulted in a non-fast-forward error.
pushAlreadyExists
Shown when git-push(1) rejects an update that does not qualify
for fast-forwarding (e.g., a tag.)
pushFetchFirst
Shown when git-push(1) rejects an update that tries to overwrite a
remote ref that points at an object we do not have.
pushNeedsForce
Shown when git-push(1) rejects an update that tries to overwrite a
remote ref that points at an object that is not a commit-ish, or make
the remote ref point at an object that is not a commit-ish.
statusHints
Show directions on how to proceed from the current state in the output
of git-status(1), in the template shown when writing commit messages in
git-commit(1), and in the help message shown by git-checkout(1) when
switching branch.
statusUoption
Advise to consider using the -u option to git-status(1) when the command
takes more than 2 seconds to enumerate untracked files.
commitBeforeMerge
Advice shown when git-merge(1) refuses to merge to avoid overwriting
local changes.
resolveConflict
Advice shown by various commands when conflicts prevent the operation
from being performed.
implicitIdentity
Advice on how to set your identity configuration when your information
is guessed from the system username and domain name.
detachedHead
Advice shown when you used git-checkout(1) to move to the detach HEAD
state, to instruct how to create a local branch after the fact.
amWorkDir
Advice that shows the location of the patch file when git-am(1) fails
to apply it.
rmHints
In case of failure in the output of git-rm(1), show directions on
how to proceed from the current state.
【讨论】:
哦,谢谢!我对命令行没有太多经验,之前的所有命令都给了我反馈。所以这让我很困惑:) 当然。阅读此答案以查看 git 显示的帮助消息的完整列表。 ***.com/questions/36794501/… 很高兴为您提供帮助。这是另一个有用的答案 - 不相关,但你可以从中学到一些我认为的新东西。 ***.com/questions/34519665/… 如果您喜欢,请随时投票。拨款。花时间写它:-)以上是关于为啥我看不到 git 命令的输出?的主要内容,如果未能解决你的问题,请参考以下文章
java jdk安装成功了,但是为啥我在cmd命令模式中javac 类名.java中总是找不到文
为啥在终端中没有 getch() 就看不到 hello world 的输出;虽然我可以使用 memcpy() 函数查看多个 printf 吗?