Search code examples
gitgithubclone

Github Desktop doesn't recognise my copied folder from external source which contain .git files


So I tried to work on a project in two laptops. I've committed this project folder into Git via Github. Then I move this project folder into local Google Drive folder, and let the Google Drive sync it into the new laptop. On the new laptop, I have downloaded Github Desktop and have signed in to my account. Now, the folder is already synced from Google Drive, but I don't see any repo on the Github Desktop. When I click on the + button on Github Desktop, I see "Add", "Create", or "Clone" only. How can I have the same Github repo entries like on the previous laptop without cloning (as the files to be cloned is already here via Google Drive) ? If there's no way to do that, I know that I can just always clone from the repo, and then overwrite the local repo with the files from the Google Drive so that the most recent changes (which I still haven't ready to commit yet) is there. But I'm just curious if it's possible. Thanks.

PS: I've already open terminal on the folder, run ls -aef, and see the .git hidden folder is there.


Solution

  • In my opinion, this is a bad idea to use the Google Drive synchronisation with a Git folder. Git's purpose is to sync your projects already, you should not let another program do that before git !

    You have to clone your project and then do commit - push - pull between your PCs.

    Why do you want to use Google Drive if you commit your code on GitHub ?


    Anyway, you just have to click on "Add" and locate your local git repository. Then it should take a minute to display your branch commit and all the files.

    Let me know if it helped :)