Linus Torvald is the inventor of Git. Millions of engineers use Git, which is the most widely used version control system in the world. It facilitates the management of all the project’s files. Every update is tracked via Git. A file can be restored to a prior version if you make a mistake, or you can even reset the version of all the project files at once.
A Git Repository is a collection of all project files in any version. It essentially functions as a folder where you can update your files before running Git commands to store the changes and pull in changes from other contributors. On our PC, you can have a separate Git repository for each project you are working on.
Table of Content
Things You Should Know About GitHub and Android Studio
Why use Git?
- Branching/Merging is free
- Open Source
- Extremely Fast
- Scalable
- Cheap
Samsung Android Studio
The official IDE (Integrated Development Environment) for developing Android apps is called Android Studio. It is based on IntelliJ IDEA from JetBrains.
How to Install Git in Android Studio
Installing Git is required before you can proceed; this program can be obtained from the official website at git-scm.com/downloads.
Step 1: Choosing Operating System
- Choose the operating system that you are working on within the download section. The download should start immediately.
Step 2: Installing Git
- After the download is complete, you can start start the executable, select “Yes,” and then press “Next.”
- The task of building up the trail is now crucial. As a result of Android Studio’s ability to recognize Git, it is strongly advised to keep it as the default route.
- Then proceed to hit next while maintaining the default settings. Finally, you need to click “Install.”
- Git should be installed on the PC when you click “Finish.”
Step 3: Setting Up Git
- Let’s see if Android Studio automatically recognizes the location where Git was downloaded. To accomplish this, first, choose “File” and then “Settings.”
- When you click on “Version Control” and then “Git” in Settings, it says in the top section that the path to the Git executable file is “Auto Detected,” and when you click “Test,” the installed version of Git is displayed.
Step 4: Creating Repository
- You must first create a repository on GitHub in order to install Git in Android Studio.
Step 5: Enabling Version Control Integration
- Return to Android Studio and select “VCS” (Version Control Systems) from the drop-down menu, followed by “Enable Version Control Integration.”
- Next, click “Git” and then “OK” after choosing a version control system.
- If all the files turn red, don’t worry. It is due to the fact that you haven’t yet posted those files to GitHub.
Step 6: Adding Android Studio
- Moving over to the far left now, you need to select “Project” in place of “Android” in the following step.
- After that, right-click on the first folder that appears after Git and add those files.
- Therefore, you need to add each of them to our version control system.
- All of the files should then turn green at that point.
- After being asked to comment on it, it will prompt you to click “Commit.”
- The displayed warnings are nothing to be concerned about. Git is installed in Android Studio and you have learned how to commit the files using Git from there because only the code should have any issues. You may now “Push” the files to GitHub.
Step 8: Executing Git
- Visit Git and then select “Push.”
- Next, you must “Define remote,” which is the repository to which you are uploading, and then copy and paste the repository’s URL before selecting “Ok.”
- A list of the files that were added to the repository is displayed to you. All that is left to do is click “Push.”
- As a result, you’ve published a project on GitHub.
Tips
Some basic things you can do with Git in Android Studio, such as:
- Putting Git into the project.
- Setting up connections from far away.
- Getting ready for and making changes.