Run git Bash under Windows using Mintty

Source: Internet
Author: User

Recently write C # from Linux up and down to Windows. It feels a great difference. The biggest change is---a variety of GUI tools ah ... Everywhere, a variety of search menus. Not used!! Miss BSH's Flexibility AH ~ ~ ~

Why to use Git

Git is the most popular version manager of the moment. A lot of benefits, but the most important thing is actually a little

    • Without always accessing the server, everyone has an entire warehouse

PS: Git is probably the boss's favorite, we can not even go home to work on the server or at home to do a commit ah ...:(

The Git on window

Git is developed from the Linux platform. The feature of the Linux platform is that everyone is knocking on the command line. So the Windows version of Git comes with bash based on Msys. This bash opens a simple window that simulates the Linux command environment in Windows.

This pig is a code farmer who goes from Linux to the Windows environment and is very nostalgic for bash. Born to be a dog, the most dislike of Git's GUI tools is the feeling of always having to leave the keyboard with a hand.

Kill the Ugly cmd.

But the cmd window was so shabby that it was horrible. seriously corrupt mood.

After using the bare Ben's bsh has been missing Cygwin under the mintty. But it seems too heavy for a mintty to install a cygwin of n G. Fortunately, someone singled out Mintty. Really good ah, only need to copy an EXE file can be used!!

Since it's for Msys and Cygwin, you should be able to run Git bash. Try it, sure enough.

Steps
    1. Install git Windows version First (nonsense)
    2. Go to [Google code here] (mintty download Mintty
    3. Unzip Mintty.exe to {git's installation directory}\bin, this bin directory has the key Bash.exe
    4. Put a shortcut on the desktop, the target points to mintty, plus some parameters, with my Win7 64 as an example:

       "C:\Program Files (x86)\Git\bin\mintty.exe" /bin/sh --login -i
    5. Run. All ok! and CMD say 88!

Well, wait a minute . If you go to set the properties of the Mintty window, nine to ten will pop up with an error box telling you that you can't find/home/{username}, just like this

With hints, the solution is simple. In the GIT installation directory, create a new subdirectory: Home{username}. For example, log in as Administrator and create a new directory home\administrator. The following commands can also be entered directly in the Mintty:

    mkdir -p /home/$USERNAME

Then go to setup mintty, and you'll find a. minttyrc file in the/home/$USERNAME directory. This is the saved settings file. (Like most Linux programs, it's text, there's no Damn registry)

Finally see the familiar green word black bottom, tears ran ...

Add Mintty to the right-click menu

Save the following code to the. reg file and then inject the registry (the Mintty.exe directory is modified by itself)

   Windows Registry Editor Version 5.00   [HKEYCLASSESROOT\folder\shell\minttyshell] @="Open Mintty Prompt Here" [HKEYCLASSESROOT\folder\shell\minttyshell\command]   @="\"C:\Program Files (x86)\Git\bin\mintty.exe\" /bin/env CHEREINVOKING=1 /bin/bash -l -i" [HKEYCLASSESROOT\Directory\shell\minttyshell]   @="Open Mintty Prompt Here"   [HKEYCLASSESROOT\Directory\shell\minttyshell\command] @="\"C:\Program Files (x86)\Git\bin\mintty.exe\" /bin/env CHEREINVOKING=1 /bin/bash -l -i"   [HKEYCLASSESROOT\Directory\Background\shell\minttyshell] @="Open Mintty Prompt Here" [HKEYCLASSESROOT\Directory\Background\shell\minttyshell\command]   @="\"C:\Program Files (x86)\Git\bin\mintty.exe\" /bin/env CHERE_INVOKING=1 /bin/bash -l -i"

Small shortfall

Git Bash's own VI does not work properly in mintty. However, this problem can be solved by installing gvim yourself. Install the Gvim and add the path to the Gvim.exe location.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.