简体   繁体   English

如何为Git启用命令行

[英]How to enable command line for Git

I've just started with Git, and I can't figure out how to enable command line for Git. 我刚刚开始使用Git,但我不知道如何为Git启用命令行。 I see many posts suggesting the use of msysgit to enable the Git command line, and I also see many other tools that can work around it. 我看到许多建议使用msysgit启用Git命令行的帖子,并且我还看到许多其他可以解决该问题的工具。 But currently I just get the Git client tools for Windows from GitHub. 但是目前,我只是从GitHub 获得WindowsGit客户端工具 Then I can use the git command in my windows command console. 然后,我可以在Windows命令控制台中使用git命令。 I don't know if it includes the msysgit in it. 我不知道它是否包含msysgit

The git client tools will include msysgit. git客户端工具将包括msysgit。 You might need to add the git bin directory into your path for ssh to work correctly with cmd (and powershell) 您可能需要将git bin目录添加到您的路径中,以使ssh与cmd(和powershell)一起正常工作

Also, I would highly recommend "posh git" which is a powershell module that gives you some tab completion and a git prompt in powershell, if you are a windows person, its likely you are more comfortable scripting in PS than in bash, and posh git is great for that. 另外,我强烈建议使用“ posh git”,它是一个powershell模块,可以在Powershell中为您提供一些制表符完成和git提示,如果您是Windows人士,则在PS中编写脚本比在bash和posh中编写脚本更舒适git很棒。

find instructions here on how to install it. 此处找到有关如何安装的说明。

Note on Windows usage: you should use Git with the provided msysGit shell (Unix style), it allows to use the complex lines of command given in this book. 关于Windows使用的注意事项:您应该将Git与提供的msysGit shell(Unix风格)一起使用,它可以使用本书中给出的复杂命令行。 If you need, for some reason, to use the native Windows shell / command line console, you have to use double quotes instead of simple quotes (for parameters with spaces in them) and you must quote the parameters ending with the circumflex accent (^) if they are last on the line, as it is a continuation symbol in Windows. 如果出于某种原因需要使用本机Windows Shell /命令行控制台,则必须使用双引号而不是简单的引号(对于其中带有空格的参数),并且必须使用以circumflex重音符号(^ )(如果它们在行的最后),因为它是Windows中的延续符号。

http://git-scm.com/book/en/Getting-Started-Installing-Git http://git-scm.com/book/en/Getting-Started-Installing-Git

Are you using the msygit shell? 您在使用msygit shell吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM