Android Studio Development Fourth version management Git (bottom)

Source: Internet
Author: User

The previous section describes how to associate a remote repository under as, and this article describes how to apply it in the development process.

Submit +push

If the local development code changes or if you think a feature is done, you're going to commit the change code to the remote repository, which is simple,

Or find the VSC arrow pointing up button on the toolbar.

At this point the Commit Changes dialog box pops up, and then the Blue commit button below the right drop-down triangle, select the Commit and push

After the local commit succeeds, the push commit dialog box pops up and the push is pushed to the remote repository.

Update +pull

We change the code directly in the remote repository to impersonate someone else's code submission:

At this point we press the down button in the tool bar VSC and the following dialog box pops up:

If you do not know how to choose the Help button can be clicked, will open the link to tell you what the role of these several.

Failed, no trace of the branch ...

Follow the previous knowledge or pull it first:

There are no optional branches,,,?

Follow the previous knowledge or fetch first

Ok,fetch is still easy to succeed, huh.

And then, merge changes:

This box is a bit like the pull frame, but here the merge branch can be selected.

The merge was successful.

At this point the VSC button will succeed:

OK, in the future you can click the VSC Two button on the toolbar directly.

Try again, change the file again at the remote repository, then pull.

It was also a success.

View status

In Android Studio projects, you can see various files in the project structure panel, where

Black file: Indicates that the remote directory is already synchronized. If you change the contents of the file then it will become purple.

Red file or directory: represents a file or directory that is not versioned. Of course, it can be added to the control, through the Git/add can be added to version control, add success will become green.

Green file: Represents a local commit, but does not push to the remote repository. How you change the green file is still green before you push to the far end.

Purple file: Represents a file synchronized with the remote repository and has been changed locally.

First I add a new file, which is smart for Android studio to prompt me, or to add Git version control.

You'll see the MyClass in the project file changed from red to green.

The mainactivity shown is changed, MyClass newly added

Submit at this time:

In the upper right corner of the Commit message, new 1 Modyfied 1 represents a new file and a file has been modified.

This time press submit, pop out a Code Analysis dialog box, saying some files are problematic.

This shows that the Androidstudio feature is a code refactoring, code analysis artifact AH.

Of course, this time can go back review can also be directly submitted.

What if I want to commit a file that already exists in the project to git: Turn green after Git/add and press commit the following window appears:

The. Gradle directory is red, indicating that the files in this directory are not version controlled.

Android Studio Development Fourth version management Git (bottom)

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.