The most all-time GitHub use: Getting Started with GitHub to mastering--backup

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

"First knowledge of GitHub"

First, let's all shout "Hello Github" together. That's yeah!.

Git is a distributed version control system that was originally written by Linus Torvalds and used as the management of Linux kernel code. Since its launch, Git has also been a big success in other projects, especially in the Ruby community. Currently, many well-known projects, including Rubinius and Merb, use Git. Git can also be used by deployment tools such as Capistrano and Vlad the Deployer. Similarly, the source code for the client is hosted on GitHub.

GitHub can host a variety of git libraries and provide a web interface, but unlike other services like SourceForge or Google code, GitHub's unique selling point is the simplicity of branching from another project. Contributing code to a project is simple: first click on the "Fork" button of the project site, then check out the code and add the changes to the code base you just separated, and finally request a code merge from the project owner through the built-in pull request mechanism. GitHub has already been called the code player's MySpace.

Branching on GitHub is like in MySpace (or Facebook ... To make friends, you are constantly wired in the nodes of the social graph.

GitHub uses a git distributed version control system, and Git was originally created by Linus Torvalds to help with Linux development, which is for Linux platforms, so git and windows are never the best friends because it's not like windows 。 GitHub released GitHub for Windows, providing an easy-to-use Git graphics Client for Windows platform developers.

GitHub for Windows

GitHub for Windows is a Metro-style application that integrates the posh-git extension of the self-contained version of the Git,bash command line Shell,powershell. GitHub provides a basic graphical front-end for Windows users to handle most common versioning tasks, creating repositories, submitting patches to the local repository, and synchronizing between local and remote repositories. Microsoft also provides developers with a GIT version control system through CodePlex, and GitHub has created a more compelling version of Windows.

On GitHub is an auto-configured Mac notebook, a tool that can convert settings to Linux or Windows machines.

Boxen is a GitHub automation tool that sets up and configures Mac notebook software development [3] or other types of work that are being used by their developers, attorneys, designers, shippers, etc. Our idea is to prepare the system in a way that is automated and as error-free as possible with minimal intervention work. On GitHub, with a new development machine, his Mac system is set up and ready to commit code within 30 minutes.

Boxen based on the collection of a large number of dozens of puppet modules, which enables the setup of various software such as Cassandra, MongoDB, Java software, Python and ruby Development, nodes, Js,nginx, Skype, and even Minecraft. Although the machine is equipped with a pre-configured, each user can adjust the role of its configuration.

"How to use"

1. Register your account and create a warehouse
The first step to using GitHub is, of course, registering a GitHub account. After that you can create a warehouse (free users can only build public warehouses), create a New Repository, fill in the name after create, there will be some warehouse configuration information, this is a simple git tutorial.

2. Installing the client Msysgit
GitHub is a server, we need a git client to use git on our own computer, I choose Msysgit here, this just provides the core functionality of Git, and is based on the command line. If you want a graphical interface, just install Tortoisegit on msysgit basis.

After loading the msysgit right mouse will have some more options, in the local repository right-click Git Init here, will be more than a. git folder, which means that the local git created successfully. Right-click Git bash to go to the GIT command line and configure SSH key to upload the local repository to GitHub.

3. Configure Git

First, SSH key is created locally;

[Plain]View Plaincopyprint?
    1. Ssh-keygen-t rsa-c "[Email protected]"

The following [email protected] changed to your mailbox, then asked to confirm the path and enter the password, we use the default all the way to the line. Successful words will be generated under ~/. SSH folder, go in, open, copy the key inside.

Go back to GitHub, go to account Settings, choose SSH keys,add ssh key,title on the left, and paste the Key. In order to verify success, enter it under GIT bash:

[Plain]View Plaincopyprint?
    1. $ ssh-t [email protected]

If it is the first time will prompt whether continue, enter Yes will see: You ' ve successfully authenticated, but GitHub does not provide shell access. This means that you have successfully connected to GitHub.

The next thing we need to do is upload the local repository to GitHub, and then we'll have to set up username and email, because GitHub will record them each time it commits.

[Plain]View Plaincopyprint?
    1. $ git config--global "your name"
    2. $ git config--global "[Email protected]"

Go to the repository you want to upload, right-click Git Bash, add remote address:

[Plain]View Plaincopyprint?
    1. $ git Remote add origin [email protected]:yourname/yourrepo.git

The following yourname and Yourrepo indicate that you re-github user name and the newly created warehouse, added after the addition of the. git, open config, here will be a remote "origin" content, this is just added to the long-range address, You can also modify config directly to configure the remote address.

4. Submit, Upload

Next, add some files to the local repository, such as the Readme,

[Plain]View Plaincopyprint?
    1. $ git Add README
    2. $ git commit-m "first commit"

Upload to GitHub:

[Plain]View Plaincopyprint?
    1. $ GIT push origin master

The git push command pushes the local repository to the remote server.
The git pull command is the opposite.

After modifying the code, use GIT status to view the file differences, use git add to add files to commit, or use Git add-i to add files intelligently. After Git commit commits this modification, git push uploads to GitHub.

5.gitignore file

Gitignore as the name implies is to tell git to ignore the files, this is a very important and useful file. In general, we write the code after the compilation, debugging and other operations, which will produce a lot of intermediate files and executables, these are not code files, do not need git to manage. We see a lot of these files in git status, and if we add them with Git add-a, it's too cumbersome to add them manually. Then we need to gitignore. For example, General C # projects My. Gitignore is written like this:

[Plain]View Plaincopyprint?
    1. Bin
    2. *.suo
    3. Obj

Bin and obj are compiled directories, which are not source code, ignore; suo files are vs2010 configuration files, not required. This way you will only see the source code file when you are in Git status, and you can rest assured that Git is add-a.


We can create a tag to point to a key period of software development, such as the version number update can be built with a "v2.0", "v3.1" such as the label, so in the later review will be more convenient. Tag is very simple to use, the main operations are: view tag, create tag, verify tag and share tag, these blog below are detailed explained.

"related usage articles for GitHub"
Git Introduction, installation, Git+git flow use:
Git Instruction set:/HTTP
Install Git-flow procedure on Mac: Http://
Git Simple use of FETCH: Update remote code to the local repository:
How git makes a single file fallback to the specified version: /archive/3351.html
How to use open source projects on GitHub:
Window (8) to install Msysgit, Gitflow, github:
git hit tag:
The Open Source Project Guide for EoE based on GitHub:
Git Stash How to use: archive/190.html
Git Tag usage:

Plain English explains how to contribute to the project on GitHub code:

The most all-time GitHub use: Getting Started with GitHub to mastering--backup

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: 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.