Open In App

How to Use Git Commands in Android Studio Terminal?

Improve
Improve
Like Article
Like
Save
Share
Report

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


Last Updated : 27 Mar, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads