1

I'm working on a project where my team need to work together at the same time modifying files in a folder. These changes have to be synced at real time (ATM I'm using resilio-sync to sync the files). Although this works great, I need a more robust way to do the versioning of these file changes, for this I thought about using GIT. The problem is that when person A commits a change in the repo, person B will have conflicts in his git as resilio-sync already updated his files but the local git needs a pull to be updated causing tons of unwanted conflicts to be fixed every time a commit is made.

How can I overcome this situation?

underthevoid
  • 513
  • 1
  • 6
  • 17
  • The core principles of the tools you try to combine are fundamentally different. If you *want* synchronization, you clearly *don't* want git-style versioning. Settle your mind on a workflow then the tools to achieve it will follow. What's the reason you need to sync everyone's files in the first place? Interesting question anyway. Also possible that I don't see the whole picture, tell us more. – Romain Valeri Apr 11 '19 at 09:31
  • @RomainValeri thing is: in this project we use the file-sync system as a way to the team test changes. Their local folders are synced to a central host where they can modify the files and see the changes in the application - these changes are set by the host. Alongside that I feel the need to use GIT to proper manage versioning. – underthevoid Apr 11 '19 at 09:56

1 Answers1

0

I've found your question while searching for a reliable way of keeping my deep learning experiments in sync. resillio sync works well with the artefacts like models and datasets, while I keep the source code in git for change tracking.

Syncing .git with automated tools is never good idea, see numerous threads about git folders being trashed by dropbox.

So you should keep .git out of synced folder, there is a simple way to achieve this by placing a config file in your source dir.

Your repo would be save, but you will end up with conflicts as you described.

This could be partially fixed by telling git that your checkout contains the latest changes by running:

  • git fetch to get remote changes
  • git reset --mixed origin/main to tell git that the checked out folder contains latest files from origin/main with potentially additional changes that were not committed.

However the command above will trash your local commits, and I don't see a reliable way to keep them.

If I find a good workaround I will update this answer.

Piotr Czapla
  • 25,734
  • 24
  • 99
  • 122