GitHub repository using detailed graphics Tutorials (command line and graphical interface version)

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

Submission: MDXY-DXY font: [Increase decrease] Type: Reprint time: 2015-08-06 I want to comment

Today we are going to learn about GitHub use, we will use it to manage our code, you will find the benefits of it, of course, after this series of tutorials are all finished, so please keep up with the pace of the webmaster, today is the first day, we learn how to build their own repository on git, and upload the code to the warehouse

Git is a distributed version control system, and as an open source code base and version control system,Github currently has more than 1.4 million developer users. As more and more applications move to the cloud,Github has become the preferred method for managing software development and discovering existing code.
> 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.
>

As mentioned earlier, as a distributed version control system, there is no concept of the main library in Git, and each copy of the library can be used independently, and any inconsistencies between the two libraries can be merged.


>

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.


>

Baidu Encyclopedia: http://baike.baidu.com/view/3366456.htm


Today we're going to learn about GitHub's use, and we'll use it to manage our code, and you'll find its benefits, of course, to be in this seriesTutorialsAfter all, so please follow the webmaster's pace, today is the first day, we will learn how to build their own version of the repository git, and upload code to the warehouse.

###Tutorial "one"

One, the registration of a free git account, you can create unlimited access to the public version of the warehouse, registered address: Https://github.com/signup/free

Second, fill in order, the user name "nickname", the email address "to log in", Password, click "creat an account" to register

Third, click "Sign In" on the top right to login to git using the registered mailbox

Four, click on the top right, your user name after the icon, create a new version of the warehouse

Five, in the "Repository name" column to fill in the name of the repository, we assume "test", the description column is a description, can be filled.

The default access is public, we click the "Creating Repository" button to create our first version of the warehouse.

Next, we need to install it locallygit client

Six, take windows as an example, download the client: Http://github-windows.s3.amazonaws.com/GitHubSetup.exe, after the installation is complete, there will be two icons on the desktop, Git shell and GitHub.

Seven, the two icons are command-line tools and graphical interface, we first learn to use the shell.

Eight, double hit open git Shell, "Win7 User Open with Administrator privileges"

Nine, inputgit config --global user.name "d1php", the d1php here is the webmaster registered user name, you have to change to your own

X. INPUTgit config --global user.email "[email protected]", the mailbox here is also the webmaster registered mailbox, you have to change to your own

Xi. the above two steps in the client configuration of your Git account, the following we build their own version of the warehouse, the webmaster to build the repository on the D disk. Inputcd d:, switch to the D-disk directory.

12. Inputmkdir test, create a test directory,Note that the local warehouse name is the same as the repository name established in Git

13. Inputcd test, enter the test directory

14. Inputgit init, initialize the repository of repositories

XV, inputtouch README, create a Readme file

16, open the Readme file with a text editor, enter a little file, for example: This is a test!

17. Inputgit add READMETo add the file to the upload queue

18. Inputgit commit -m ‘test commit‘, the cache commits, the quotation marks are the description of this submission, must be filled in, cannot be empty

19. Inputgit remote add origin https://github.com/_d1php_/test.git, note the URL format, d1php is your nickname when registering, test is the repository you just built

20. Inputgit push origin master, upload the Readme file to the repository. This step will allow you to fill out your git registration email and password at once, and be careful not to fill in the wrong

Well, by this step, we've completed all the steps to build a git repository and upload files online and offline. The next lesson is to learn about GitHub's use, and the graphical interface is certainly easier to accept.

Tutorial "Two"



In the last lesson we learned about the initial use of Git shell, and today we're going to learn about GitHub's graphical interface.

First, double-click the GitHub icon on your desktop

Second, in the Open interface, click Log In, as shown in the figure:



C. Enter the user name and password in the interface as shown in:


History of the most difficult phper pen question "Click into" 40 points can be a monthly salary million! 2000 multiplayer test, 85% accuracy rate view


D. Click Log in to enter the interface shown:


History of the most difficult phper pen question "Click into" 40 points can be a monthly salary million! 2000 multiplayer test, 85% accuracy rate view


V. Click ' Continue ' to enter the interface shown:


History of the most difficult phper pen question "Click into" 40 points can be a monthly salary million! 2000 multiplayer test, 85% accuracy rate view


Six, we do not find the local version of the repository, this is because the GIT client by default in the C-drive git directory to find the repository, and we built in the last lesson in the version of the warehouse in the D drive, so we can not find, it's OK we find, click Skip, enter the interface shown:


History of the most difficult phper pen question "Click into" 40 points can be a monthly salary million! 2000 multiplayer test, 85% accuracy rate view


Click ' Tools ' and select ' Options ' in the drop-down menu to enter the interface shown:



Eight, navigate to the D-Disk directory, and then click on Scan for Repositorie to scan the local repository as shown in:



Nine, soon found our last lesson built the version of the warehouse, test, click on the bottom left of Add, and then click Update to enter the interface shown:



Enter the D:/test directory, create a new txt file named Hello, enter the Hello world!, and then click the arrow in the Open repository to enter the interface:



Xi. the left column will list the most recent changes to the file, the first column on the right to fill in the description of this submission, we fill in ' Hello World ', the second column is a detailed description, you can not fill in. After filling out, click ' Commit ' to submit, enter the interface shown:



12, on the right we can see just the new submission: Hello World, click Publish, upload our changes to the GIT repository on the line.

13, wait a moment, you can complete the upload, as shown:



Once the upload is successful, we can see the submission just completed on the left. Then we visit the warehouse on the line and check: https://github.com/d1php/test

Yes, there are 2 more files in the test warehouse on the line.

Well, here we've done a file upload using the GitHub GUI, and we'll go back to Gitshell in the next lesson. We will use Gitshell download online version of the warehouse to the local, if you have doubts about this tutorial can contact webmaster Oh.

Tutorial "three"



Today we are going to learn how to use Gitshell to download a repository of online repositories locally. Why do we have to download the online warehouse to the local, usually we want to participate in other people's projects.

GitHub has a project above: Https://github.com/octocat/Spoon-Knife, click to access it.

Now that we want to participate in this project, we need to take the following steps:

First, visit the link above, click the Fork button,

Second, now the Spoon-knife project has been added to your online version of the warehouse, we want to download it. Open Gitshell, input https://github.com/d1php/Spoon-Knife.git , note here d1php should be your nickname when you register, use the webmaster's account.

Three, the first two sections we set up the version of the warehouse in the D packing directory, so the default is in the D-disk directory only want Shell, into D, will find a spoon-knife directory, the source code has been downloaded.

Iv. inputcd spoon-knife

Input git remote add upstream https://github.com/octocat/Spoon-Knife.git , here we use the original project address, to ensure that we can keep track of the original project

Six, input git fetch upstream , get the original project with the latest changes to your local repository, but do not modify your local files

OK, how to download the online warehouse to the local learning here, next lesson we learn how to build a version of the branch.

Tutorial "Four"



Study, you are persistent! Welcome to the Webmaster continue to learn the use of GitHub, today we will learn how to use Gitshell build version branch. If you want to build on the original project to try some new ideas or develop new features, modifications and so on, you can create a branch of the original project, so that when the original code is not affected by the changes. We set up a test repository for the first few lessons, and today we're going to set up a branch for it.

First, open Gitshell, enter cd test , enter the local test repository

Second, inputgit branch testbranch

Three, input git checkout testbranch , set Testbranch branch to current work branch

Iv. input git add ./ , add all files of the test directory to the upload queue

V. Input git commit -m ‘newbranch‘ , cache submission

Six, input git remote add origin https://github.com/d1php/test.git , configuration upload target Warehouse

Enter git push -u origin testbranch , upload the file to the branch

Then visit: https://github.com/d1php/test/branches, you will find a branch more testbranch!

How about, today's study is very easy. Tomorrow we will learn how to use the GitHub image interface to download changed files from the online repository to local, or "Version Synchronization".

Tutorial "Five"



Today we learn how to use the GitHub graphical interface to keep our local version repository consistent with the online repository, or how to download files that have changed in the online repository locally.

First, we visit https://github.com/d1php/test. Remember the Hello.txt file we created in the first lesson? As shown in the following:



Double-click the file and come to the interface shown:



Third, click the Edit button and make some changes to the text, as shown in:



After you finish editing, click the Commit Changes button at the bottom of the page:



V. Open GitHub as shown in:



Click the arrow on the right to open the local repository as shown in:



Seven, GitHub will automatically read the latest changes, and there will be a blue sync "sync is the meaning of sync" button. If you don't see the blue icon, you can click the F5 refresh screen. Now we click on the Sync button, so github will download the changed files on the line to local, as shown in:



After downloading the game, the Blue Sync will turn gray in sync, which means the latest files have been downloaded to the local repository, check it out! How about that, right?

Thank you for following the webmaster for 5 days of study, tomorrow we will continue to learn the use of GitHub graphical interface, we will learn how to use the GitHub graphical interface to build a repository branch.

Tutorial "Six"



Learning, sometimes is a long and boring process, but when you go to the end, back to look at this section of the road, you will show a nonchalant expression! Today we learn how to use Gitgui to build a version branch.

To open the GitHub graphical interface, click on the blue arrow to open the test repository we created earlier, as shown in:



Second, in the Open interface, click the Master button, as shown in:



Third, in the pop-up window, click the Manage button as shown:



Enter the branch interface, move the mouse over the master branch, and click the plus sign as shown:



This creates a new branch based on the file of the Master branch.

After clicking the plus sign, the input box pops up, enter the name of the new branch, and click the Branch button to create the branch, as shown in:



The webmaster input is TESTBRANCH2, because before using Gitshell to establish a testbranch branch.

After creation, the new branch is displayed on the current page, as shown in:



Click the Publish button to publish the new branch to the GIT repository on the line. After publishing, the Publish button becomes unpublish, indicating that the branch has been uploaded to the warehouse on the line.

Vii. visit https://github.com/d1php/test/branches To view the branching situation as shown in:



We will find that although there are 3 branches displayed, but only 2 are present on the page, the newly created one does not appear because the default is to read the master branch and not the branch that is integrated with master, and the TESTBRANCH2 branch we just created is modeled as Master. So there's no difference between them, so it doesn't show. We click the Branch drop-down button to see the TESTBRANCH2 branch we just created.

Eight, click on the Testbranch2 button to enter the interface shown:



Now we can see the branch we just established in the repository of the online version.

Now we go back to the sixth step of the GitHub GUI and move the mouse over to the new branch Testbranch2, as shown in:



The first red circle in the icon is used to delete the branch, it will also delete the local and online warehouse branches; the second red circle simply deletes the branches in the online warehouse and the local branch is retained. Now, click on the icon that surrounds the first red circle and delete both the local branch and the line branch.

Ten, visit https://github.com/d1php/test/branches, we will find that the TESTBRANCH2 branch that was just established has been deleted, and the branch is no longer displayed in Gitgui.

OK, so we learned how to create, publish, and delete branches using the GitHub graphical interface, and in the next lesson we'll learn how to use the GitHub graphics community to work with branch versions.

Articles you may be interested in:
    • The use of the IsDigit () function and the Isxdigit () function in C language
    • AnalogClock of Android control and analysis of DigitalClock usage example
    • How Git uses pits out of memory errors
    • Installation of the Git eclipse plugin
Link Address: http://www.jb51.net/article/70729.htm

GitHub repository using detailed graphics Tutorials (command line and graphical interface version)

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.