Installation and configuration tutorial for Git bash

Source: Internet
Author: User
Tags commit svn ssh git client version control system

Distributed: Git version control system is a distributed system, is used to save the project source code history State of command-line tools;

Save point: Git can keep track of the files in the source code, and can get the whole project amount status at a certain point in time; Can be in the save point of multiple submissions of the source code merge, you can also fall back to a savepoint;

git offline operation: git can be offline for code submission, so it is called a full distributed processing, git all the operations do not need to be online; This means that git is much faster than tools like SVN, because tools like SVN need to be online to operate, and if the network environment is bad, the commit code becomes very slow;

Git-based snapshot: Old version control tools like SVN save the commit point to a patch file, and Git commit is to point the commit point to the project snapshot at the time of submission, which contains some metadata (author, date, GPG, etc.);

git branching and merging: The branching model is the most significant feature of Git, because it changes the developer model, and SVN and other version control tools put each branch in a different directory, and git can switch between different branches in the same directory;
Branch immediacy: Creating and switching branches is done almost simultaneously, the user can upload a subset of branches, another branch can be hidden locally, without having to upload all the branches to GitHub;

Branching flexibility: Users can create merge delete branches at any time, multi-people realize different functions, can create multiple branches for development, then branch merge, this way makes development fast, simple and secure.

My blog: code Daquan: www.codedq.net; amateur grass: www.xttblog.com; Love sharing: www.ndislwf.com or ifxvn.com.
git Universal client official download address

Http://git-scm.com/downloads git Software Installation

Welcome interface: Direct Next;

Agreement: must be accepted;

Installation location: Reserved 100M space, custom installation location;

Select Installation components: You can also choose by default;

My blog: code Daquan: www.codedq.net; amateur grass: www.xttblog.com; Love sharing: www.ndislwf.com or ifxvn.com.
-Icon Component (addition icons): Choose whether to create a Quick Launch bar icon or whether to create a desktop shortcut;
-Desktop Browsing (Windows Explorer integration): The way to browse the source code, a separate context browser only using bash or git GUI tools only; Advanced contextual browsing methods using the Git-cheetah plugin plugin;
-Association Profile: whether to associate a git configuration file that mainly displays the style of the text editor;
-Associated shell script file: whether to associate a script file executed by the bash command line;
-Use TrueType encoding: whether to use Truthtype encoding at the command line, which is a generic encoding developed by Microsoft and Apple;

Start Menu Shortcut directory: Set the directory name of the shortcut in the Start menu, or you can choose to create a shortcut from the Start menu again;

Set environment variables: choose what command-line tool to use, in general we use GIT bash by default, the default choice;
-git: Git bash command-line tool that comes with git;
-System comes with cmd: command-line tool using Windows system;
-both have: The above two are configured at the same time, but note that this will cover the Windows Find.exe and Sort.exe tools, if you do not understand these try not to choose;

Select a line break format:
-Check out the conversion of Windows format to UNIX format: Wrap a line in Windows format into UNIX format to commit;
-Check out the original format to UNIX format: No matter what format, all into the UNIX format of the line to commit;
-No format conversions: Do not convert, check out what, just commit what;

To start the installation:

End of installation: over;

Configure GitHub

In the Start menu, find Git bash right-click Properties and modify the GIT bash configuration: set git bash to quick edit mode for better use of the command-line tool:

My blog: code Daquan: www.codedq.net; amateur grass: www.xttblog.com; Love sharing: www.ndislwf.com or ifxvn.com.

Create a local ssh (a way to transfer code that is fast and secure.) Detailed can go to Baidu Check data) (also can choose HTTPS transmission, then skip this step.) )

Ssh-keygen-t rsa-c "13241153187@163.com"

GitHub mailbox: The mailbox behind this command is the registered mailbox of GitHub;
Path selection: After using this command, you will be prompted to select the Ssh-key build path, where the direct click to enter the default, the generated Ssh-key in the default path;
Password Confirmation: Here we do not use a password to log in, with a password too troublesome;

Configure SSH to GitHub

Enter the generated SSH directory: C:\Documents and Settings\administrator\.ssh (or C:\Users\ own computer user name \.ssh), use Notepad to open the Id_rsa.pub file and copy the contents of the file ;
Id_rsa.pub File Contents:

Ssh-rsa aaaab3nzac1yc2eaaaabiwaaaqeatt1yceanulpfc+arqawrcdfpi6cpw3gkgt0hp6q8by7nnefy4dah9cwsrnbwjh5es4tiqcke+ bdbsvnvabofd1mtgzjtze4gdweg/6j/sdyv/adfn/rlwgb+5rq8wmcjc/fodgljdfxk1fwk/ttqtcbtlab1tolcts3zgiw5dsta3rq0ccx/ spew5m7vh7dckxluj2tbd9hw== 13241153187@163.com

Go to GitHub: Login to GitHub and select account Setting user settings:

Select the Ssh-key option on the left:

Click on the Add SSH key on the right:

Copy the Ssh-key copied in:

Verify that the configuration is successful:

Ssh-t git@github.com

Validation may allow you to enter Yes.

Success prompt: If Hi han1202012! appears You've successfully authenticated, but GitHub does not provide shell access. This indicates that the configuration is successful and can be connected to GitHub;

Configure local Users and Mailboxes my Blog: Code encyclopedia: www.codedq.net; amateur grass: www.xttblog.com; Love sharing: www.ndislwf.com or ifxvn.com.

User Name Mailbox role: We need to set a username and mailbox, which is used to upload a local repository to GitHub and display code uploader on GitHub;
Use the command:

git config--global user.name "Hanshuliang"//Set user name 
git config--global user.email "13241153187@163.com"//Set Mailbox

The GIT client has been installed and the GitHub configuration is complete, and now the code can be transferred from GitHub. set git local project development Library default path

If you set it up, you don't have to open the directory every time you turn on Git and CD. Method: Right-click git shortcut icon (called: Git Bash), find the shortcut-start location, put your project address here. The following figure:

My blog: code Daquan: www.codedq.net; amateur grass: www.xttblog.com; Love sharing: www.ndislwf.com or ifxvn.com.

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.