GitHub Novice Detailed Tutorials

Source: Internet
Author: User
Tags commit ssh hosting email account git clone ruby on rails

This article was written by myself about GitHub, from the steps I've just heard until it's set to a successful step, with a few screenshots or code coming from the Web.

First of all, I have a simple introduction to GitHub, GitHub has a very powerful feature is that you can create a library on the server (later on how to create), writing code is a very heavy task, especially when many people complete a large project, it is very complex, A group of people to write a project together, everyone completed the time, the completion of the progress are not the same, you write a little I write a little, maybe even you write today error, affect the code I wrote yesterday, finally how to make everyone's code easily summed up, How to find errors after summarizing everyone's code and a series of questions. So we're going to use the GitHub software. We have a main repository on the GitHub server, which is used to store all of your code, and if you don't pay for it everyone can see it, and if you don't want anyone to see your code, you can choose a paid warehouse. After we create the main warehouse, we can create the branch on the computer, then you can complete their own code on the computer, after writing the direct synchronization in the branch of the computer, when you think you can upload your own main warehouse, you can apply for updates, when the audit, your code appears in its own main warehouse, So that programmers all over the world can see your code. The world now has 3 million of registered users, and even some fairly well-known open source projects are also publishing code in it. On GitHub you can see a lot of the computer-savvy elite sharing their own code. This is the two main advantages of GitHub for team collaboration and for downloading the code of other great people.

Today, GitHub is: a community of 1.43 million developers. Among them are top hackers such as the Linux inventor Torvalds, and young geeks such as Rails founder DHH.

· The most popular open source hosting service on the planet. Currently hosting 4.31 million Git projects, not only are more and more well-known open source projects moving into GitHub, such as Ruby on Rails, JQuery, Ruby, ERLANG/OTP, and nearly three years of popular open source libraries often start on GitHub, for example: BootStrap, node. js, Coffescript, etc. Alexa Global rankings 414 website.

https://github.com/This is GitHub's official website, can register their own GitHub account on the official web, the internet is full English, for the students who are not good English suggestions to use Google Browser, Google Browser can translate the page into Chinese use is very convenient.

After a simple step you will have a GitHub account that belongs to you. After a simple registration, you will need to verify the mailbox you entered in order to use your github properly.

After the registration is complete, you will need to create a library of your own after completing some simple settings.

After landing your GitHub account, the small plus sign in the top right corner of the page is the button used to create your own library, and after that, after the steps to translate the webpage into Chinese, follow the prompts to create your own library.

The first box is the name of your own library, the second box is a brief introduction to the library

After you've created your own library, let your computer clone a library of your own, and sync the code on your computer to the one you created on GitHub.

To achieve this, you need to install a software, Git Bash.

Here I will introduce the installation of this software, as well as the simple configuration.

Git-scm.com first go to the GitHub website and download the right version for your computer

Run after downloading the installation package

The direct default option is available during the installation process.


Most novices are confused when configuring Git bash, and I'll have a detailed record of each step of the configuration. Code I also from the Internet and seniors to come.

The first time I opened the software to see this interface is also a face, and then by looking at a variety of data after a few ideas.

First of all to create a local SSH key This is the purpose of you now need to get a key on your computer, is our usual code of the same thing, after obtaining, in your GitHub account inside the input, your computer and your GitHub account is linked together, This makes it easy to upload your code at any time via git bash. Here's how to enter your github if you get this key.

A lot of people open this github for the first time and look at it and think what it is. For a novice to see this is no idea, no idea.

This column starts with the name of your computer in my here is Hanani @ behind the content is your computer model, many times some people open after the @ is garbled, this time also do not care, because some computer models are Chinese, may appear in the time of the problem, does not affect your later operation.

Next, start getting your own key. All of the features in Git bash are implemented with some simple code. You need to enter the key when you get it

$ ssh-keygen-t rsa-c "your_email@youremail.com"

This code needs to be entered, and the quotation marks need to be changed to the email account you are bound to when registering for GitHub. Then there will be some simple to let you confirm the operation, and then you will be prompted to operate the path, password, and so on, in general, directly press enter a passing on it can.

If you have this interface after that, it means that your key has been successfully created. Now you need to go to the storage location where he just showed up and copy the contents.


In the. SSH folder

After that you will see the content, some people will have a pub behind the Id_rsa, before watching the online tutorial need to find a file with pub, because I did not have a. pub file after the build, with a disturbed heart opened Id_rsa found here side of the key is also available. When you open Id_rsa, you need to open it in Notepad.

Ssh-rsa aaaab3nzac1yc2eaaaadaqabaaabaqdiskxqzf3ssftack6zongjabiktbc3kig6+ 4j4dcq1tswha9ykujci0wprmgywbq67dyt2or7redfzlullzn3nl6awlo5v2jrxw4wqxcon2ru1p122wmitzqyofsykjwullwv4byczu4n77a4/ 9wwlsqzcpebcdwv8imkvwfjuinswqtvmymcktwu8yad5dz2v7lbwfgsl/tfx7aeb8ujdnj6spw30yijy+ 62yrftyggbuwoil9hdngo2lfjgokglhtbjaze31uqllwc5uczd+7dgh7rakmmeuz2uv7yqm/ IEU9JH8CPMR9YRPIHMZG38G2S9ILN27QQW9J1HRFY1V 15229020556@163.com

This is the key I have acquired, open it for a long time, don't be surprised, no problem, this is the key you need.

Now you need to login to the top of your github to add this key,

Open your GitHub settings screen, find SSH and GPG keys after this option, in the top right corner of the page there is a add new SSH keys click

The title here is to give you a name for your key, according to your personal preferences, what name can be, and then the key you copied in the file just, fill in the box below. Save it.

And then you can go back to your git bash.

Then enter the code above to check if the binding was successful. The first time you bind the code above will prompt whether continue, after entering yes if it appears: You ' ve successfully authenticated, but GitHub does not provide shell access. That means it's been successfully connected to GitHub. Next you need to set up something simple.

Enter the above code, the name is best and the same as on GitHub, email is must register GitHub's that email address

The order of the two can be reversed, without a fixed order.

The following will be the clone of your library down to the local computer, easy to upload code later.

After the library is created, a URL appears in the Web page.

Personal habit of storing your own files in the D drive, so you need to locate Git bash in the D drive first

Enter cd/d note in git bash the name must be capitalized. If you do not enter this statement to the GIT bash location, the default local file location is in the C drive.

The/d instructions appear after the input is successfully positioned.

then enter

The URL behind git clone is the URL you created after creating the library.


Then open the D drive I'm targeting.

As you can see, there are already folders created with my library name in the D drive.


Open this folder and create a file of any name in it, in any format.

Then reposition git to position the book in your library's folder.


After entering the LS statement the function of LS is to look at the files in the folder you are currently targeting, and now you can see that the test file I just created has already appeared.


Then enter git add test.txt

Then enter and then git commit-m "CC" Quotes inside the content can be arbitrarily changed, this statement means to you just upload a note, easy to find memory


This occurs after the input, and then after you enter GIT push Origin master, a

Interface, click Login after logging in to your previously registered GitHub account.

If this happens later, the login fails and you need to enter your GitHub account name

The interface will appear after you enter it, and then enter your GitHub password again.


With a similar interface, you can cheer and be successful on your behalf.

Now open your GitHub website and find the library you created

Find today's grid is green, indicating that you have uploaded the file you just created.

After that, you just have to put your code in the corresponding folder of the library, then use git add, git commit-m "", and finally git push Origin master, to submit your code.

I also feel that the web version of GitHub is more suitable for novice small white, https://blog.csdn.net/hanani_jia/article/details/79855429 this is I wrote a web version of GitHub simple operation, need to look.

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.