Use your Git Bash tool happily

Source: Internet
Author: User
Tags ssh using git

Git bash is a natural use when using Git under Windows, and I'll share some of the Git bash tips.

Official download Address http://msysgit.github.io/ Set the initial path

The default Git Bash initial path is the installation directory, and every time you open it, it's a bit of a hassle to go to our project.

Now we find the "Git bash.vbs" file in the installation directory and open it with a text editor:

Add the line of code labeled and set the path you want.

Shell. CurrentDirectory = "D:\"

Later we will run Git Bash to open the "Git bash.vbs" file.

PS: There is another better way, if you create a git bash shortcut when installing, then right click this shortcut, the "Start location" to your project directory, save. turn on copy and paste

Git Bash is not able to copy and paste text with the mouse by default, but we can easily turn this feature on.

Click the upper-left corner of the Git Bash screen and click on "Properties" to tick "quick edit mode". using SSH keys

Do you want to enter the password repeatedly without pull,push each time? Using SSH keys can help you achieve this requirement.

First, we're going to generate SSH keys.

This is the GitHub official web-based SSH key generation tutorial in Windows Https://help.github.com/articles/generating-ssh-keys

Once the SSH key is generated and the key is added to your Github, we simply change the URL of our Git project from HTTPS to the SSH protocol.

Open your local project and enter:

$ git Remote-v
Origin https://github.com/someaccount/someproject.git (fetch)
origin https://github.com/ Someaccount/someproject.git (push)
You can see the HTTPS protocol now, log on to your Github project, and view the URL of the SSH protocol for that project.

Copy the SSH URL and enter:

$ git Remote Set-url origin < you copy the url>
When you are finished, you can view it by entering the command:
<pre name= "code" class= "plain" >$ <span style= "font-family:arial, Helvetica, Sans-serif;" >git remote-v</span>



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.