Androidstudio sharing items to git

Source: Internet
Author: User

There are two scenarios in which Android Studio shares projects to git,

1 There's already a project under development.

2 Create a new project on Git, and then ...

First, download git, and install

http://git-scm.com/downloads/

Second, specify the path to the git command in the file-settings in studio,

       Select the path to the GIT client in path to git executable. find install git Git.exe

in the  bin directory

Click the "Test" button to the right of the table of contents, if the following window appears to indicate successful configuration:

Method one applies to new projects

Create a warehouse on [email protected] to get an HTTPS connection to the [email protected] warehouse, for example Https://git.oschina.net/yuechenglei/Memo.git

Vcs--checkout from Version control--git paste URL in the Studio toolbar

Set the directory location and click Clone.

will create and copy the warehouse file to the local project and you can do git add commit in the local project.

First prompt for open source China account and password

After the validation is passed, the remote Git project can be copied locally.

Note If the GIT repository project is not managed based on Gradle, it will prompt for conversion to gradle management, preferably in this way, please refer to the information for specific conversions.

After modifying the code, Select the project right click-git-commit Directory popup, select "Commit and push" commit, the file will be submitted directly to the remote repository,

Note that if you choose Commit to submit the file locally, it is not synced to the open source China git repository

Method Two applies to an existing project

Create a warehouse on [email protected] to get an HTTP connection to the [email protected] Warehouse http://git.oschina.net/********

First turn the project into a git project, step: Vcs--import into Version control--create git Repository in IntelliJ to select your local project in the popup window


Then associate the local git to the GIT server (you need to create a project in Oschina git and then copy the project's Git address).

Use Git bash to enter the project root directory

Perform:

git remote add Origin https://git.oschina.net****** (please replace your own item in the actual use)

After entering the user & password, complete.

After execution

Git push-u Origin Master


If the submission fails, refer to the GIT prompt for a workaround such as a remote address can be git remote rm origin cleanup

If there are other files in the warehouse that are not in the local project, you can refer to the following two figures first the merge project is used: Git pull origin master then executes Git push-u Origin master

I submitted at the time of the everything up-to-date prompted, check the data also did not solve, I hope the great God assists, but I use the right button project

Git-repository-push submitted successfully ...

The project is submitted to [email protected]. After the operation of everyone is familiar with.


GitHub is also similar in that it is based on git versioning, such as the ability to add GitHub accounts directly.

Want to be associated with GitHub and [email protected]

OK

The following URL needs to be changed to another address that you want to associate.

You can then use studio to move directly to two push

Androidstudio sharing items to git

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.