Get started with GitHub to upload a local project

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


GitHub is a git-based implementation of code hosting. Git is the best version control system available today, and is much more popular than SVN.

GitHub is free to use and fast and stable. Even for a paid account, the cost of not exceeding 10 US knives per month is also very cheap.

With GitHub, you can archive projects, share conversations with others, and let other developers help you with this project. The advantage is that he supports multiple people to complete a project, so you can talk on the same page.

Create your own projects and backup, the code does not need to be saved locally or on the server, GitHub is doing very well.

There are also many benefits to learning about Git. He is seen as a pre-maintenance process, you can recover as you need, submit problems, or you need to recover any form of code, can avoid a lot of trouble. One of the best features of git is the ability to track errors, which makes using GitHub easier. Bugs can be made public, and you can submit errors via GitHub comments.

On the GitHub page, you can start directly without having to set up a host or DNS.

For me, I can edit the same set of code in the company and the home, with a U disk or a network disk is very troublesome to say

Theory says too much easy to forget, to practice it.

Outline: First, create GitHub repository (warehouse) Two, install Git client three, set up SSH key IV for GitHub account, upload local project to GitHub

First, create a GitHub repository (warehouse)

1-1 Logging in to GitHub

GitHub official website: https://github.com, if no account, hurriedly register a.

Click Sign in to enter the login screen, enter your account number and password to login to GitHub.

1-2 Creating a Repository (warehouse)

Why call Repository (warehouse). I was beginning to wonder if it was simpler and clearer to call the code base. But carefully pondering, the warehouse is generally put food, it is the code as a full belly of things, more love, instantly feel this cold cold code filled with chakra.

Pull away, see how to create a warehouse, you can see the Repository tab after logging in

If not in this page also does not matter, click on the top right corner of the picture next to the small triangle, expand can see your profile, click Enter can also see repository

Switch to the Repository tab and you can see the new button that is very visible. Don't hesitate to click on it and start creating your own granary.

The following is the creation of warehouse information, only the name is required, and now I created a warehouse called: Beautifulday

Once created, you can see your warehouse address, so my remote free warehouse is created. It also describes the common instructions for the GitHub warehouse.   This command requires a local git client to be installed. Git init//Turn this directory into git can manage the repository git add readme.md//file add to Repository git Add. Not only can be with a single file, but also with wildcards, you can follow the directory. One point to put all the files in the current directory are not tracked all add git commit-m "first commit"//submit files to the repository git remote add Origin git@github.com:wangjiax9/pract Ice.git//Associated remote repository Git push-u origin master//push all the contents of the local library to the remote library

Second, install the Git client

Git is currently the world's most advanced distributed version control system, five basic differences between Git and SVN. It has the following characteristics:

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.

2-1 Download git client

Official Download Address: http://git-scm.com/download/According to your own system download the corresponding version, did not expect it to know that I am windows ^_^

2-2 Installing the Client

Download good after we start to install it, welcome interface, next.

Choose the installation path, do not choose the path with Chinese, and sometimes cause unnecessary misunderstanding.

Select the installation component and press the default to do so.
1) Icon Component (addition icons): Choose whether to create a Quick Launch bar icon or whether to create a desktop shortcut;
2) Desktop Browsing (Windows Explorer integration): The way to browse the source code, separate context browsing using only bash or git GUI tools only; Advanced contextual browsing methods using the Git-cheetah plugin plugin;
3) association configuration file (Associate. git*): Whether to associate a git configuration file that mainly displays the style of the text editor;
4) Associated shell script file (Associate. sh): Whether to associate a script file executed by the bash command line;
5) Use TrueType encoding: whether to use Truthtype encoding at the command line, which is a generic encoding developed by Microsoft and Apple;

Set the directory name of the shortcut in the Start menu, the default is OK, the next step

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

Choose the line-wrapping format, which is still the default.
1) Check out the conversion of Windows format to UNIX format: the line wrapping in Windows format to UNIX format is being submitted;
2) Check out the original format to UNIX format: No matter what format, all into the UNIX format of the line to commit;
3) do not format conversion: Do not convert, check out what, just submit what;

Select terminal Emulator, still the default is good

1) using Mintty, Windows opens a simple simulation Linux command environment for Windows git Bash

2) command-line procedures for Windows-cmd.exe systems

Select default is good, do not use file system cache

Installation ...

Git finally installs successfully.

2-3 Binding Users

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.