How Android Studio uses Git to submit code to GitHub and Oschina and resolve conflicts

Source: Internet
Author: User

由于本人喜爱Git,那就介绍Git,,如何和在GitHub和Oschina拉取和提交项目,并且你会学会如何解决冲突问题!!博主还是那个图片控!!
Preparatory work

Git:git Download
Oschina Registered Address: Oschina
GitHub Registered Address: GitHub
1. Download the GIT software
2. Register your github account and Oschina account
3. After completion 1.1 and figure 1.2

Figure 1.1 Git Configuration Success Flag

Figure 1.2 GitHub is associated with local as success
To do this, in order to do the following, I overlooked a lot of, those really very basic, the use of resources I put in the last link. Easy to download.

Submit the project to GitHub

After the AS (Android Studio) 1.3 can be configured with one-click version control, so I only recommend a simple and practical method. If 1.3

Follow the steps in the diagram to see if there is a better understanding of the picture than the text narrative, if not, please leave a message, I will correct.
When clicked, will appear lets you enter the password, tries to set a oneself not to forget the password, saves the forgotten. Then you can open your GitHub account and discover that the project has been submitted.

Submit the project to the Oschina

Because Oschina is a Chinese version of GitHub, uploading to Oschina can be free to build a private project and faster than GitHub, so I usually put some items on the Oschina, the method is a bit of a coincidence!!
Step: First submit the project to a public project on GitHub, and then create a private project in Oschina to import the project on GitHub just submitted, 1.4

Figure 1.4 Quickly creating a project in Oschina
Then click Create, you can easily create a project!!

Pull from server to local

1.5, pull the replacement code from the server to the local

Figure 1.5 Replacing code from GitHub or Oschina
Click on the URL that appears after 1.6.1 and 1.6.2 you want to pull the code
GitHub

Figure 1.6.1
Oschina

Figure 1.6.1

And then start pulling the code, 1.7

Figure 1.7 Select the content you want to pull

Code push to server

Warm tip: Before committing the code to ensure that their code is up-to-date, if not the latest need to update the code, and then test whether the normal operation in the submission code!!
1. Right click, first add, then submit, then submit to server
2. I recommend the method, 1.8

Figure 1.8 The process of uploading a server
Let's go from the top down process, first click the UP arrow
Step 1: Click the up arrow and then pop up the dialog box
Step 2: Double-check what you want to submit
Step 3: Introduction to writing Changes
You can then choose commit (Commit to local only) and commit and push (commit to local and commit to server)

How to resolve conflicts in multi-person development projects

If you find that there is a conflict when you update your code, the as will pop up a dialog box, 1.9

Figure 1.9 Code conflicts
Click the merge button and then resolve the conflict between you and other people, if unsure of the situation, it is best to find a colleague, ask him how to write, avoid conflict!!

Reference:
Git plug-in for Android Studio and Eclipse operation "code submission" and "code conflict"

How Android Studio uses Git to submit code to GitHub and Oschina and resolve conflicts

Related Article

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.