Android Basics Getting Started tutorial--1.5.2 git using GitHub to build a remote repository

Source: Internet
Author: User
Tags hosting how to use git version control system

Android Basics Getting Started tutorial--1.5.2 git using GitHub to build a remote repository

tags (space delimited): Android Basics Getting Started Tutorial

Introduction to this section:

In the previous section, we learned how to use git, build our local repositories, easily implement versioning and code restores, modify log viewing, and so on; the reader is certainly not satisfied with the local yes, if it is more people to develop a program together? We need a remote repository as a server! Of course, it costs money to build a server, so why not host the project on GitHub? As an open source code base and version control system, GitHub 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, without any cost, and why not to use it? Right! This section will learn how to host our code on GitHub!

1. Account Registration & Warehouse Creation:

Open GitHub Website registration: GitHub official website, fill in the registration information: Users say, email, password

After registering, jump to the following page, select the Warehouse purchase method (private warehouse, others can not access, to permissions), generally we play choose free:
PS: Right, at this time your mailbox may receive a verification message, click to complete the verification.

Next, create a repository of our code:

Add a point content hint to your warehouse, which is an overview of the project (writable and not writable)

A brief introduction to some of the things on the homepage:

2.Clone Code Library to local

Of course, you can clone directly with the graphical interface, but I still like to clone from the command line, first copy the next clone's address

And then somewhere, there's a key to open git Bash:

Type:

git clone https://github.com/ZPJay/Garbage.git

You can then see that our code base is ready to download:

Open the folder to see the following:

3. Branch Management

The branch may be unfamiliar to a friend who has just contacted the version Control tool, but he will bring us great convenience! Confined to space,
The author directly lost a link, we look at the picture to know: Cao She's official website: Create and Merge Branches! Write really good ~ Recommended collection!

After understanding the concepts, let's familiarize ourselves with several commands related to branching:

① Create a branch (the latter creates a branch switch):

git branch v1.0.3 或 git checkout -b v1.0.4

② See all the branches in the repository:

git branch -a

③ Switch to a branch:

git checkout v1.0.3

④ Delete a branch:

git branch -D v1.0.4

⑤ Merging Branches

 git merge v1.0.3

4. Local warehouse and remote warehouse synchronization issues

The previous branch operations were done locally, saying the project was hosted on GitHub, and we're definitely talking to the remote repository.
We have tried to download the project locally using the Clone command before last year, so how do we synchronize the code on GitHub after we have modified it? Let's start with a little bit of modification to our local repository, then git add and git commit are prepared locally and then:

git push origin master 或者直接 git push

Submit our local content:

Then take a look at our GitHub and see that the content has changed and the submitter is another account of mine!

There is synchronization to the server, there must be server synchronization to the local yes, very simple, just a

git pull

'll be

5. Summary of this section

Well, this section is written so much, I believe you see the above git tutorial also has some conflict resolution, branch management, bug Branch waiting for advanced git usage, considering this is the introductory tutorial, do not write so deep, interested can understand their own, say the company's current situation:
① uses GitHub as our project management tool: We are all hosting the project on GitHub, then there are two branches: develop and test two branches, one branch per version, and then merge the branches to master on the last release! Mention of the bug is also mentioned above, or more convenient!
② use Trello to do process control, but also relatively concise and efficient! Interested can learn about!
In addition, the domestic visit to GitHub may be relatively slow, and if the private warehouse is to charge, if the company does not use agents or private development, may be slightly chicken, but you can consider the use of domestic open source warehouse: [email protected], provided by open source China, Provided 1000 private warehouses, as if, feeling good, interested to consider hosting the code here: http://git.oschina.net/!
Here, if there is a mistake in the text, welcome to point out, thank you ~

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Android Basics Getting Started tutorial--1.5.2 git using GitHub to build a remote repository

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.