Easy and fast integration Git (Github) in Android Studio

Volha Kurcheuskaya
4 min readNov 27, 2022

--

Git is a distributed version control system: tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, date integrity, and support for distributed, non-linear workflows (thousands of parallel branches running on different systems).

I’ll show you the many features of Git support in Android Studio and also how easy it is to do the different Git operations (commit, push, pull, branch, etc.) from inside Android Studio.

In this tutorial, I’ll walk you through the list of points that are available in Android Studio.

  1. Git installation
  2. Signing up for a new GitHub account
  3. Integrating a new Android Studio project with Git
  4. First commit
  5. Pushing from a remote repository

Git Installation

Let us now look at the various steps in the Git installation. Download the latest version of Git and choose the 64/32 bit version. After the file is downloaded, install it in the system. Once installed, select Launch the Git Bash, then click on finish. The Git Bash is now launched.

Check the Git version:

$git –version

For any help, use the following command:

$ git help config

This command will lead you to a browser of config commands. Basically, the help the command provides a manual from the help page for the command just following it (here, it’s config).

Another way to use the same command is as follows:

$ git config — help

Signing up for new account in github

GitHub offers personal accounts for individuals and organizations for teams of people working together. You can create a personal account, which serves as your identity on GitHub.com, or an organization, which allows multiple personal accounts to collaborate across multiple projects. For registration use github

after go to settings:

  • Click on your avatar in the top right hand corner
  • Choose Settings -> Developer settings -> Personal access tokens
  • Click on the “Generate new token” button

and generate personal token

please copy the token, we need it in the future.

Create an Android Studio Project

Fire up Android Studio and create a new project

After your Android Studio project has been set up.

  • Go to File -> Settings -> Version Control -> GitHub -> Add an account
  • Click on the “Use Token” hyperlink, like in your screenshot
  • Paste your token, click login, click ok

Now you can share your project on github

android studio->VCS -> Share project on Github

Create first commit

And pushing on github

after you project pushed on your github

now your project is stored not only locally, but also in a remote repository

Conclusion

In this tutorial, you learned how easy integrate Git to Android Studio. Using Android Studio’s Git tools makes it easier and more efficient to collaborate on Android projects with other developers.

--

--