Command-line Git on Windows

前端 未结 9 1934
悲&欢浪女
悲&欢浪女 2020-12-07 09:44

I have installed msysGit 1.7.10 on my Windows 7 machine. What I need to know is if I can still use Git from command line?

When I try the git command in

相关标签:
9条回答
  • 2020-12-07 10:25

    You can install chocolatey. It's like apt-get in Linux, you can install using the command line. Run Command Prompt as Administrator and type choco install git and you'll be able to install git devoted to the command line.

    0 讨论(0)
  • 2020-12-07 10:26

    These instructions worked for a Windows 8 with a msysgit/TortoiseGit installation, but should be applicable for other types of git installations on Windows.

    • Go to Control Panel\System and Security\System
    • Click on Advanced System Settings on the left which opens System Properties.
    • Click on the Advanced Tab
    • Click on the Environment Variables button at the bottom of the dialog box.
    • Edit the System Variable called PATH.
    • Append these two paths to the list of existing paths already present in the system variable. The tricky part was two paths were required. These paths may vary for your PC. ;C:\msysgit\bin\;C:\msysgit\mingw\bin\
    • Close the CMD prompt window if it is open already. CMD needs to restart to get the updated Path variable.
    • Try typing git in the command line, you should see a list of the git commands scroll down the screen.
    0 讨论(0)
  • 2020-12-07 10:28

    In the latest version (v2.19 for Windows when I'm writing), if you choose the option "Use git in Windows command prompt" (or sth similar, please read the options carefully when you install git), you should be able to use git commands in windows command prompt or windows powershell without any additional setting. Just remember to restart the command line tool after you install git.

    0 讨论(0)
提交回复
热议问题