Version-controlled git tutorial (top)

Source: Internet
Author: User
Tags using git version control system

1. Introduction to Git

Git is a version control tool for Linux kernel development that uses a distributed repository approach that does not require server-side software to operate version control, making it extremely convenient to publish and communicate source code.

The Git basic interaction flowchart is as follows:


There are two ways to use Git for versioning, one is to use the msysgit command line, and the other is to use the graphical tool Tortoisegit, but both methods need to be installed Msysgit.

1)msysgit is a Windows version of Gitthat provides command-line operations:

http://msysgit.github.io/ or https://git-scm.com/

2)tortoisegit is A free open source client of Git version control system, which is git version controlled Windows extension. Allows you to avoid boring and inconvenient command lines. It is fully embedded in Windows Explorerand can be used just by right-clicking in a normal window.

https://code.google.com/p/tortoisegit/ or https://tortoisegit.org/download/

2. Git installation Tutorial

2.1, the installation of Msysgit

The following is the installation tutorial for the latest version of Msysgit 2.8.2 , with the installation package named Git-2.8.2-64-bit.exe.

When the download is complete, double-click the installation and double-click to open the installation Settings screen. Then click "Next", the following interface to configure the installation components, by default, including the creation of desktop shortcuts,git Bash,git GUi, Already directory and suffix associations, etc. Click "Next".

In theadjusting your PATH environmentoption, the default is OK. This step is best to select the second item "use Git from theWindows command Prompt" So that the command line cmd in Windows You can also run the git command. Click "Next" to continue:

Configure the line end tag to keep the default "Checkout Windows-style, commit unix-style lines endings".

In the Terminal emulator Selection page , the default is to configure Git Bash terminal to be easier to use. Then click on "Next"

Finally configure Git to choose the default. Then click "install" to start the installation. If you have previously installed an older version, you will first uninstall and then install the new version.

Finally, a window will pop up and click Finish .

2.2, the installation of Tortoisegit

Double-click the downloaded installation package, the first few options can be default, when it appears to enter the Choose SSH Client page, select the tortoiseplink option:

Select the next button to enter the Custom Setup page, using the default or specified path to install;

When the following window appears, then congratulations on your installation success, then you can use it.

Configure the installation after it is complete

Right-click tortoisegit to Enter the settings screen

Set user name and mailbox

3. Advantages of using Git

Conflicts can easily be resolved between any two developers.

Why it 's easy to resolve conflicts with Git, first look at the Open source Project workflow diagram:

As shown, when using Git for versioning, there is a main developer and several developers, only the main developer has to submit the code to GitHub, and the rest of the developer has finished the function by Create patch sends a patch to the main developer, then the main developer gets the patch apply patch and Push it to the server, This effectively solves the problem of code conflicts.

4. Use Git to host your code to GitHub

It's not about you being a it Newcomer or a Daniel, the basic you need a GitHub account so you can be on GitHub Share your results or download a project that is excellent.

The first step--sign up for a GitHub account:

Baidu Search GitHub, enter the official website registration can, as to how to register not to say, I believe everyone will.

Step Two-Login to GitHub: Go to GitHub website and click sign Github:

Step three-Create a project

Login to the GitHub account, click New repository,

Then you will jump to the next page, fill in repository name , which is your project name , where Add. Gitgore is selected according to the language you use, Add a license is a compliant open source protocol, and when completed, click creat repository to create the complete.

Copy the address and record the address of your project;

Use the tortoisegit tool to Clone The warehouse you just built

When it appears like, then congratulations, the project was successfully cloned.

And then you'll find a folder like this locally

Next you just upload the file, the following I upload a project named clearedittext folder;

First UseTortoisegitof theAddcommand to add a newly added file or folderAddcome in and then useGit Commitsubmit the file locally, in useTortoisegitof thePushUpload files toGithub. We need to be awareTortoisegitof the Pulland theTORTOISESVNof theUpdateis the same feature that will synchronize the latest code of the server to local.

When the upload succeeds, it will appear as follows:

To add a static picture using Github, refer to:

Http://blog.chinaunix.net/uid-26495963-id-3367377.html

To add a dynamic image using Github, refer to:

Version-controlled git tutorial (top)

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.