Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio: Unregistered VCS root detected

Unregistered VCS root detected The directory /Users/*****/AndroidStudioProjects/Signin/google-services is under Git, but is not registered in the Settings. Add root Configure Ignore How to resolve this? Please help.

like image 311
Felix josemon Avatar asked Oct 08 '15 06:10

Felix josemon


3 Answers

Press "add root" when the warning message appears.

This will make idea register the "unregistered vcs root", and you can use the git features of IDEA/Android studio. Nothing bad will happen if you do not press "add root", but I suspect you will get the same warning on each startup of android studio/IDEA.

like image 133
nilsmagnus Avatar answered Oct 17 '22 08:10

nilsmagnus


You are able to ignore that warning if you are not interested in using Android Studio's git integration. Or, you can enable git integration under the VCS | Enable Version Control Integration menu.

like image 24
iagreen Avatar answered Oct 17 '22 09:10

iagreen


VCS stands for "Version Control System", aka "undo on steroids". No programmer should be without it.

IDEA (which Android Studio is based on) sees some signs in your project directory that your project source is set up to use a Version Control System.

In this case, the VCS in use is git. The sign is the presence of a projectdir/.git subdirectory.

That indicates that you either created this project directory by "cloning" this project from a git repo:

$ git clone https://github.com/projectname/reponame.git

Or that you created your own git repo in the project directory, by cd'ing to the projectdir and running the command:

/path/to/projectdir $ git init-db

By clicking "add root" you tell IDEA to add this git repo to IDEA's internal settings for the project, so you can use the IDEA features that support using git. I recommend using it, it won't interfere with your ability to use git from the command line, but some of the IDEA git features are handy.

If you don't know/use git, I highly, highly recommend that you learn it. It will make your life a lot easier, in the long run. As I said, it's like "undo" on steroids.

If you already know how to use git, here are a few of IDEA's git features.

The niftiest feature is that you can select a few lines of code, right-click and select Git/Show History for Selection.

The most useful feature (to me) is Alt-9 aka View/Tool Windows/Version Control.

This brings up the version control window, a pane across the bottom of the IDEA gui.

By default the Version Control Window just shows "Default" (in bold) and "Unversioned Files".

Expand "Default" to see the files that changed.

Expand "Unversioned Files" to see any files that need to be added to git.

The color indicates the status, all configurable of course, the default config is that blue indicates changed, green indicates added, etc.

Right-click/Show Diff on a changed file and it gives you a nice visual diff, sort of reminiscent of Meld's UI, which is one of my favorite, because it uses these sort of cartoon "word ballon" indicators for each difference, to illustrate where the difference would be in the other version.

Also, the side of the visual diff that shows the current file appears to be a fully functional (or mostly functional) IDEA editing window, making it easy to fix any gratuitous differences.

Some useful related links:

https://www.jetbrains.com/help/idea/2016.1/file-status-highlights.html?origin=old_help

Also, at the same site see:

Howto/General Guidelines/Version Control with Intellij IDEA/VCS-Specific Procedures/Using Git Integration/Checking Git Project Status

Reference/Version Control Reference/File Status Highlights

I'd include links directly to these but apparently stackoverflow doesn't trust me yet.

like image 20
Steven J Owens Avatar answered Oct 17 '22 07:10

Steven J Owens