I had a look at the image you uploaded and it seems like you have a weird git setup.
I see that you are inside the folder, ~/AndroidStudioProjects/ApiExample/
. So this is your project directory?
But it looks like you have initialized a git repository in your home directory (i.e. ~/
) and when you run git status
inside the current path, it shows everything relative to that home directory path.
In my opinion, you shouldn't have done that, and should have maintained a separate and an independent git repository for each project.
My suggestion to fix your issue is to remove the .git
directory from your home. I guess you don't have any valid projects in the root of your home dir?
First change your path to home directory:
cd ~
Then take a backup of your .git folder in case you need it.
cp -r .git .git-backup
Then remove it.
rm -rf .git
Now go back to your AndroidStudioProjects
, there also you shouldn't be having a git repository.
cd AndroidStudioProjects
Remove the .git folder.
rm -rf .git
Finally, go to your ApiExample
project folder, and initialize a new git repository there.
git init
Now everything should be fine. But you should know that this is only a suggestion to clear your mess. If you really had a valid git repository inside your home directory, or AndroidStudioProjects
directories, then you need to use Git Submodules
.
Hope it helps. Feel free to ask any doubts.