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 Use Git Shell Commands? Git is a powerful version control system that is important for managing source code in modern software development. While there are many graphical user interfaces (GUIs) available for Git, mastering Git shell commands can significantly enhance your productivity and control over your repositories. Th
3 min read
How to Change Git Username in Terminal? Suppose you're using Git for version control. In that case, you might want to change your Git username for various reasonsâwhether it's for correcting a typo, updating it to a new username, or switching to a different account. You can change your Git username in two ways:Globally: This sets the user
3 min read
How to Install and Use Git in Google Colab? Google Colab is a popular platform for data scientists and machine learning enthusiasts to write and execute Python code in a Jupyter Notebook environment. While it provides a robust environment for coding, integrating version control systems like Git can enhance productivity by allowing you to trac
2 min read
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 Fix "Unable To Show a Git Tree in Terminal"? Git is an important tool for version control, and displaying the Git tree in the terminal is a common way to visualize your branch structure, history, and commits. However, you might sometimes encounter an error saying "Unable to show a Git tree in terminal" which can be frustrating.In this article,
4 min read