In this post i am gonna show you how to work with TFS Git using Android Studio!
Before starting with this guide, make sure you have the below Pre-requisites.
- Android Studio (2+)
- IntelliJ Plugin ( https://plugins.jetbrains.com/plugin/7981 )
- Active VSTS/TFS account
This post helps you to simplify and optimise developer interaction with TFS and VSTS Git repositories from IntelliJ or Android Studio. These provide on-premises and cloud collaboration services for version control, agile planning, software build & continuous delivery, application analytics etc.
Importing the Project into TFS/VSTS Git repo
- Open the Android Studio and select “open an existing Android Studio Project”
2. Navigate to the path of your project
3. Once the project is loaded, it will ask for adding the root to VCS (Version control System) since it is under git repository. You can add root now or later-
4. Select the project and import it to the TFS git repository-
5. Select the Project and the account to which you would like to import and click ok-
6. Once imported, you should be able to see the project on TFS- Git
Cloning a project from TFS-Git
- Checkout the project from version control –
2. Select the project you wish to clone-
3. You will be able to see the project that was checked out-
Basic commits to the repository-
- Edit the file you wish-
You will see that the files were detected locally upon modification-
2. Browse to the VCS and commit changes-
3. The edited files will be listed out during the commit-
4. Commit the changes. Do not directly commit and push the changes as that might break your main code if any conflicts-
5. You should see the successful commit message
6. Push the changes to the remote git repo-
7. You will see the commits listed under and the branch that you are pushing too. In this case, we have only “origin:master”
8. You will see the push successful message-
9. Browse to the file in web and look for the changes done-
In the next post, i will show you how to handle merge conflicts, handling pull requests etc.