How to Use Git Commands in Android Studio Terminal?
Last Updated :
27 Mar, 2023
Android Studio is the official IDE (Integrated Development Environment) for Android app development and it is based on JetBrains’ IntelliJ IDEA software. Git is a Distributed Version Control System. It is used in Software Development. Git was developed by Linus Torvalds in the year 2005 to manage the development of the Linux Kernel
Need of Git
Git allows multiple developers to work on the same project simultaneously and also, keep track of the changes made to the codebase over time or version revisions.
Common Git Commands
1. git init
initializes a new git repository
2. git add <file>
adds file(s) to the staging area
3. git commit -m <message>
commits the changes in the staging area to the repository with a descriptive message
4. git status
shows the status of the current working tree, indicating which files have been modified, added, or deleted
5. git pull
fetches and merges change from the remote repository into the local repository
6. git push
pushes the committed changes to the remote repository
7. git branch
lists all the branches in the current repository
8. git checkout -b <branch-name>
creates a new branch with the specified name
9. git checkout <branch-name>
changes current working branch
10. git clone <repository-url>
clones an existing git repository from the specified GitHub Url
11. git merge <branch-name>
merges the specified branch into the current branch
12. git log
shows the commit history of the repository
13. git remote add <remote-url>
to add a remote repository as the default remote for your local repository
Android Studio Terminal
Android Studio comes with an embedded terminal. A terminal is a powerful tool that is used to execute command-line commands and tasks like building applications, running tests, and managing project dependencies
Below is the step-by-step video for executing git commands in Android Studio Terminal
Similar Reads
How to Upload Project on GitHub from Android Studio? Learning how to upload a project to GitHub from Android Studio is an essential skill for developers, as it allows you to share your code, collaborate with others, and manage version control. With GitHub integration in Android Studio, it's easy to push your project to a repository. This guide will wa
3 min read
How to Create a New Branch on GitHub using Android Studio? Creating a new branch on GitHub using Android Studio can help your development workflow by allowing you to work on new features or fixes without affecting the main codebase. In this article, we will walk you through the steps to create a new branch directly from Android Studio and push it to your Gi
2 min read
How to Create a Pull Request on GitHub using Android Studio? Creating a pull request is an important part of collaborating on projects hosted on GitHub. It allows you to propose changes to a repository, enabling others to review, discuss, and merge your changes. Hereâs a step-by-step guide on how to create a pull request on GitHub using Android Studio. Steps
2 min read
How to Install Android Studio on Ubuntu? Android Studio is a full-featured cross-platform IDE that helps us to build applications for Android devices. Android Studio is based on JetBrains' IntelliJ IDEA. This IDE includes everything we need for Android development. Android Studio build system is powered by Gradle allowing you to make multi
5 min read
How to Install Termux on Android? Termux is a Free and Open-source Terminal Emulator which allows you to work under a Linux environment on Android or IOS Phones. It contains a built-in package manager that enables you to download and set up numerous testing and development apps across your phones. Using its package manager, it autom
2 min read
How to Clone Android Project from GitHub in Android Studio Android Studio is the official IDE for Android app development, based on IntelliJ IDEA. It supports building apps for Android phones, tablets, Wear OS, TV, and Auto using Java or Kotlin for backend and XML for UI design. Git is an open-source version control system that tracks changes in code, makin
2 min read