1

How should I best sync a GitHub repo that is also synced on Dropbox between two computers?

I had an old computer that does not power on, which had a GitHub repo that was also a Dropbox folder (so everything in it was backed up to my Dropbox).

I now have a new computer, which after I synced to Dropbox, has the entire repo. However, it is not linked to my GitHub Desktop (i.e. my GitHub Desktop application does not recognize it).

Is there a way to make GitHub Desktop recognize the Dropbox folder on my new computer as a Git repo and sync to GitHub?

VonC
  • 1,129,465
  • 480
  • 4,036
  • 4,755
  • 2
    Don't put a git repo (github or otherwise) in a dropbox folder. There has already been too many questions on stackoverflow about corrupted git repo because of dropbox. Git assumes that it has 100% control of folder content and does not like it if some other process change the content of the .git directory in parallel. Note that the answer to git corruption is usually to delete your git folder and clone from a clean copy. In your case you are lucky because you have github as backup but in general don't do it. Github is already a backup. – slebetman Sep 08 '21 at 03:45
  • 1
    To handle the case of github going bankrupt (unlikely because Microsoft is just too big to fail) you just need to clone your project to two different PCs – slebetman Sep 08 '21 at 03:46
  • Thanks @slebetman. I understand GitHub+Dropbox is a bad combo, however I had to use it to work with collaborators who did not use GitHub. So you are saying the best bet in this case is to delete the folder in Dropbox and clone it from GitHub fresh? – catchablepaper Sep 08 '21 at 03:47

1 Answers1

1

So you are saying the best bet in this case is to delete the folder in Dropbox and clone it from GitHub fresh?

What you can push in Dropbox is a bundle (using the git bundle command): that will be one file (easy to synchronize), from which others can clone/pull from: it acts as a "remote".

Plus, it won't include your local configuration (which might have sensitive information)

VonC
  • 1,129,465
  • 480
  • 4,036
  • 4,755