26

When I right-clicked in my Android Studio project (in the Android view), I used to have a "Git" submenu. There I could pull, push, etc.

However, that 'Git' menu is now gone, somehow. As a result, I can neither push nor pull. Where can I enable that again?

Zoe
  • 27,060
  • 21
  • 118
  • 148
Ralf Wickum
  • 2,850
  • 9
  • 55
  • 103

10 Answers10

46

Try this way ,

  1. In Android Studio enable the version control for the project by, VCS –> Enable Version Control Integration
  2. Open command line/terminal and add the project to Git repository by, git remote add
  3. Add files by, VCS –> Git –> Add and commit/push by, VCS –> Commit Changes

Checkout Android Studio Git Tutorial link for more detail.

as well as check this Stack Explaination.

In Android Studio, go to ‘File’ –> ‘Settings’ –> ‘Version Control’ –> ‘Git’. Then click ‘Test’ to ensure that Git is configured properly in Android Studio.

Prior to using Git or any other version control with an existing project, ‘version control integration’ should be enabled. In Android Studio, got to ‘VCS’ –> ‘Enable Version Control Integration’. This step is for an already existing project in Android Studio, that is not is integrated with any version control.

Amit Vaghela
  • 22,772
  • 22
  • 86
  • 142
4

In my case the plugins "Git" and "GitHub" ware disabled. I enabled them (Settings->Plugins->Installed) and menu "Git" had been appeared.

Oleg
  • 97
  • 6
  • 1
    Both Git and GitHub were already enabled in my case. However, I tried disabling both and then enabling them again. Restarted Android Studio and it works now. Thanks! – Shizuku Nov 24 '21 at 03:07
1

Try this:

Settings -> Plugins -> Install JetBrains Plugin -> Type "Git" on search

Then Install: VCS Annotations Preloader

Hope this process will solve your problem

1

A simple Gradle-Sync is fixing this for me. I had this after every "stash" or "unstash" now (Android Studio 3.5.3)

ox black
  • 153
  • 7
1

just enable version control again
VSC->enable version control

Amr
  • 1,068
  • 12
  • 21
0

If you don't have git repo on your project, just create a git repo on your project folder, something like

git init

and when you have git repo already, just close the project from android studio and re-open it. let android studio to refresh itself...

Mehdi Khademloo
  • 2,754
  • 2
  • 20
  • 40
0

at eventLog it will show error, git is not integrated. Press to integrate it and the problem will be resolved

Nurseyit Tursunkulov
  • 8,012
  • 12
  • 44
  • 78
  • How is it different from accepted answer ? https://stackoverflow.com/a/34991098/7237062 ? How can you guess that the OP actually had an evenLog error ? – LoneWanderer Mar 10 '19 at 12:40
  • @https://stackoverflow.com/users/7237062/lonewanderer I tried above mentioned way, but it was not useful, after an hour of trying I found this solution. So for the sake of other users to not spending so much time as I, I think that this answer deserves to be here – Nurseyit Tursunkulov Mar 10 '19 at 14:42
0

I struggled with this problem for a while and ended up using the usual nuclear option to make Git show up: File > Invalidate Caches/Restart...

enter image description here

I am using Android Studio Arctic Fox and Git 2.32.0: enter image description here enter image description here

Hong
  • 17,643
  • 21
  • 81
  • 142
0

In my case, for some reason I had two Directories under Preferences -> Version Control. One was the root of the repository (correct), the other one was root of the project (incorrect and colored red).

I couldn't check History or do any Git operation of any file.

Removing the red directory fixed it. I have no clue how it ended in there.

Maragues
  • 37,861
  • 14
  • 95
  • 96
-1

I find that, if I clone the code with terminal, the Git menu is not among the options of VCS menu.

What I did was:

  1. Click VCS menu.
  2. Checkout from version control.
  3. Select Git.
  4. Fill all the necessary info in the popup window.
  5. After cloning the code, there is a prompt saying Android Studio needs to be restarted. (Just restart it.)
  6. The Git menu should appear after restarting Android Studio.
Jonathan Ma
  • 451
  • 4
  • 6