1

I work on 2 machines, a desktop with Windows 10 and a laptop with Linux Ubuntu 19.10 There are many times where I forget to git push my latest changes and I have to resume my work on my other machine and I cannot continue because I forgot to git push.

Until recently I was using MEGA Cloud which has the option of excluding files and folders, and I was excluding *.git, node_modules and python virtual environments to avoid needless problems such as Error Permissions on Files/Folders, git unexpected behaviors and a huge amount of files/folders from node_modules.

However, it has a major problem: if you delete some files/folders on one machine and the files/folders exist on the other machine, MEGA will re-upload them (that's not syncing).

Any help for syncing my source files on a cloud automatically while it is also a git repository?

cyrics
  • 11
  • 3
  • Don't forget to push? It may sound stupid, but if you're already using Git, a little more discipline will get you a long way. Putting a Git Repo on a cloud folder is asking for trouble. You could even add a post commit hook to auto-push changes for certain branches. – jessehouwing Dec 16 '19 at 13:15
  • Discipline is not stupid, but I cannot git commit/push for every 5 mins of work or lines of code. Sometimes there are emergencies where you have to stop working for unexpected reasons this is why I'm asking for a syncing solution. I understand that syncing repos is asking for trouble and I have edited my question. – cyrics Dec 16 '19 at 13:25
  • 1
    You could add a second remote to which you force push changed on a scheduled task. – jessehouwing Dec 16 '19 at 14:47

1 Answers1

0

If you want to sync repos using MEGA Cloud, the usual suggestion is to store the repo in your synching solution and then push to it. Either way, git requires you to push your changes to the remote. It's dangerous to store your work and repo in a synching solution.

magikid
  • 308
  • 2
  • 11