Before using Git with Android Studio, there are a couple of important configurations you'll want to set up from the command line. Use the config command to set your global user name and email address. The email address in particular is important, since it's used to validate your access to remote Git repositories.
- [Voiceover] Once you've installed Git on your computer, the next step is to configure it for use in Android Studio. Go to your preferences or settings dialogue from the welcome screen you can go to configure, and then preferences on Mac or settings on Windows. Then open the version control category and click on Git. Make sure that the path to your Git executable is correct for your operating system. On Mac, if you're using the version of Git from the Git dash scm website, then the executable location will be slash usr slash local slash bin slash git.
If you're using Apple's version, it will be under slash usr slash bin. To make sure you're picking up the right version of Git, click the test button, and you should see a message indicating that Git executed successfully and showing you the version number. On Windows, if you're using the most recent version as of the time of this recording, you'll see version 2.7. If all that's working, then you're ready for the next step, configuring your Git installation. Go to a command prompt or on Mac, to Terminal, and type the following commands.
Start with git config, then dash dash global. Then user dot email, and enter your email address wrapped in quotes. I'm entering an email address that I don't actually check. I only use this email address for development configuration. When you press Enter or Return, you'll be saving that configuration for all Git projects. Then type git config, once again, dash dash global. And then this time, user dot name, and type in your full name.
The email address you enter here should match the email address of your Github account. The username can be anything at all. It's not actually used to integrate your Git projects with your Github account or anything else around Git. It's just used to keep track of commits from your system to get repositories. So, if you've done all those steps, configured Android Studio so it can find the Git command, and configured your email and name in your Git installation, you're ready to start using Git with Android Studio.
- Installing Android Studio on Mac and Windows
- Creating Android Studio projects
- Setting up the development environment, including HAXM and the new Android emulator
- Importing existing code into Android Studio projects
- Exploring the interface, including the editor and project windows
- Managing project builds and dependencies
- Creating new Java classes
- Refactoring code
- Using templates
- Using breakpoints and watch expressions
- Updating apps with Instant Run
- Using Git for version control
Skill Level Beginner
Q: This course was updated on 04/27/2017. What changed?
A: New videos were added that highlight the new features introduced in Android Studio 2.3. In addition, the following topic was updated: update apps with Instant Run.