How does android studio share projects with Git @ OSC, androidgit @ osc

Source: Internet
Author: User

How does android studio share projects with Git @ OSC, androidgit @ osc

I am the first to post this article. If anything is inappropriate, please criticize and correct it.

1. Install git. Git: http://git-scm.com/downloads/

2. Configure the git.exe command path in File-> Settings-> Version Control-> Git of AS, for example:


Configure AS git

After the configuration is complete, if you click "Test" to prompt successfully, the configuration is successful.

3. Create a repository on git @ osc to get the repository address.

 


 

 


 

Here my repository address is: https://git.oschina.net/qule510/GitDemoTest.git

4. Create an AS project.

5. Select a project in AS to create and initialize the local git repository. For example:

 


 

 

6. (enter the Key Point) enter the project directory and right-click the git command line window.

First, you need to execute the following two commands, as the basic configuration of git, To tell git who you are and the information you enter will appear in the commit you created.

Git config -- global user. name "your name or nickname"

Git config -- global user. email "your mailbox"

If you have already set it, ignore the above steps.

Enter the following command:

Git remote add origin <your project address> // here my remote repository address is: https://git.oschina.net/qule510/GitDemoTest.git

Git pull origin master

Git touch init.txt // this step is not required if a modified file already exists

Git add.

Git commit-m "first commit" // enter the submitted content here

Git push origin master // push

Follow the steps above to successfully share

If a problem occurs during the update, the following error occurs: Can't update: no tracked branchNo tracked branch configured for branch master. To make your branch track a remote branch call, for example,

Git branch -- set-upstream master origin/master

Execute git branch -- set-upstream master origin/master to update it.

Tip: For more detailed steps, you can view the OSC git help documentation: http://git.mydoc.io/

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.