

If you open it, you'll see that all file types we need to ignore are already present, including the /build directory: gitignore file in the top-level of your project directory: Once you're in "Project" view, you should notice a. You can switch between view types by simply clicking the dropdown menu directly above the filetree: However, if you switch to "Project" view, you should see it in the filetree on the left-hand side. If you're currently in the "Android" view, you may not yet see this. However, as soon as we set our VCS to Git, you'll find that Android Studio will make us a. gitignore file to exclude this content from our Git repository. When someone clones down our project, they'll re-compile their own build files on their own machine using the source code. For instance, we don't need to track our build files because their contents are simply compiled from our source code. gitignore FilesĪs you learned in your Java course, we don't need to add every single file to our Git repository.

This will create a local Git repository in the project folder. Selecting this option will result in a pop-up that allows us to select which VCS our project should use. We can do this by visiting the VCS option in the top menu, and selecting Enable Version Control Integration: Next, we need to tell Android Studio to enable version control for this project. If we click this button, our project will sync with Gradle. You can do this by selecting the "Sync Project Files with Gradle" icon in the menu. So, we'll manually tell Android Studio to sync our project with Gradle. When you first create a project, these files have likely not yet been created. This will ensure our module files are included in the project. Gradle Syncįirst, before adding anything to Git, we'll want to sync our project with gradle. This section will walk through using those options to create a Git repo, add and commit changes, create a remote repository on GitHub, and push your project to the remote repo. Working IndependentlyĬonveniently, Android Studio makes it easy to sync a project to GitHub by using a series of options built directly into their GUI (graphical user interface). As usual, setup will differ slightly depending on whether you're working independently, or working with a partner.

In this lesson we'll address how to integrate Git and GitHub into Android studio, to continue using them as the version control system for your Android projects.
