1

This might seem a very noob question, or something easy to fix, but I'm afraid I'll do worse so better be sure.

Yesterday I was reading about Github to upload my little project into a safe place, and have easy way to track and revert changes if necessary. I am by no means a dev expert, and to this as an hobby and a side passion.

Suffice to say, I've committed and pushed my proj into GitHub yesterday, and today when loading it, everything looks weird, and all my classes and files are not on the Project Tab of And. Studio.

I can somewhat see that everything seems to be there on Git, I'm just unsure how to load it back into the IDE without messing more stuff around.

Here's a quick screenshot:

enter image description here

Any help or direction (even a good tutorial/reading) would be very appreciated!

Thank you! André

Edit:
git status at the original prj root:

D:\andre\progr\Android\SeriesOganizerv004>git status
On branch main
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified:   .idea/workspace.xml

no changes added to commit (use "git add" and/or "git commit -a")  

git status on the Import from version control (different folder):

D:\andre\progr\Android\SeriesOrganizerRecover>git status
On branch main
Your branch is up to date with 'origin/main'.

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified:   .idea/workspace.xml
no changes added to commit (use "git add" and/or "git commit -a")
Andre M.
  • 33
  • 4

1 Answers1

0

Make sure you have a proper .gitignore as in here in order to not version too much (ie files that would be generated anyway)

Then try again, following How to Upload Project on GitHub from Android Studio? from Amiya Ranjan Rout

https://media.geeksforgeeks.org/wp-content/uploads/20200509001636/f62.png

Then "How to Clone Android Project from GitHub in Android Studio?"

https://media.geeksforgeeks.org/wp-content/uploads/20201103235115/Clone4.png

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you VonC! I've went thru the steps, and was able to commit a testproject and clone it back to my local machine - I think I understand how it works a bit better now! For the issue with my current project, is that I don't seem to have the /src/ folder anymore, neither locally or on github, looks like it only has build files. I can see them on the screenshot, but I'm not sure how to "convert" that back to normal java files and kinda restore my project back. – Andre M. Dec 06 '20 at 11:29
  • @AndreM. For that, it is always best to revert to command-line first, and check your .git subfolder is in the right top-level folder, not just under src/ for instance. Edit your question with a `git status` done at the top-level of your loca repository. – VonC Dec 06 '20 at 13:55
  • Added git status for both my original proj folder as well as the import from git I made to a different folder. – Andre M. Dec 06 '20 at 18:08
  • @AndreM. OK. Are the folders stucture and files identical between the initial project and the one from Andorid Studio after clone? (without counting any generated file like .class)? – VonC Dec 06 '20 at 18:18
  • looks like the original one is a tad larger (52MB vs 49MB) and has almost double the files (1400 vs 700) - Still none have the src files. Really weird that my 1st commit only pushed build like files, and erase my src dir. Would that be because of the missing ignore file? Thanks for all the help so far! – Andre M. Dec 06 '20 at 19:07
  • @AndreM. possibly a wrong `.gitignore`. In the first original repo, check the output of `git check-ignore -v src/aFileInSrc` – VonC Dec 06 '20 at 19:29
  • both returned empty :( – Andre M. Dec 06 '20 at 20:58
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/225594/discussion-between-vonc-and-andre-m). – VonC Dec 06 '20 at 21:21