Is putting a Git workspace in a synced folder really a good idea?

Okay, say, I’m in a hurry, and I have 5 projects with uncommitted changes. One of them has a new config file with sensitive information in it (e.g. an API key), which isn’t in .gitignore yet, and since I don’t have time to cherry-pick, I just git add -A everything and push it to a public repo. This is just one harmful situation which could’ve been avoided if I were using a synchronization tool (not to mention that it’s also automatic, so I can’t just forget to, say, commit 1 project out of 5).

1 Like

Seems that the topic have been pretty active recently :smile:

Just for you all to know everything is running smoothly since I’ve been asking for help. I’ve never had any problem so far for my usage and in my setting which is a bit specific:

  • The git repo is not very active (< 2 commits / push / pull a day)
  • I’m the only user of the repo
  • Syncthing is NOT always running in the background; for conservative reasons, I only fire it up when I have to sync my computers before heading out or after getting back

Generally speaking I’d advise not to push/pull/commit git repos while having Syncthing running in order to lower the synchronizations required. I’ve got no objective reason to do so but it seems just more logical and clean.

My 2 cents.

2 Likes

Thanks for chiming in. That’s what I decided to do myself too. This is essentially a semi-automatic rsync, where a single button does everything :slight_smile:

2 Likes

Just an extra tuppence-worth.

I’m a single user syncronising a (Linux) desktop computer with a (Windows) laptop. I’m sometimes jumping between different branches in a repo quite quickly, which sometimes means a lot of files changing very rapidly.

Mostly Syncthing seems to cope really well with this, but I recently had a number of old (deleted, local) branches resurrect themselves. I don’t know if this was Syncthing or not, but I have added .git to my .stignore just in case.

What I lose is having any purely local branches syncronised between the two machines, but I don’t really need that, and I don’t like having to try to remember which branches I had or hadn’t previously deleted!

3 Likes

This topic was automatically closed 29 days after the last reply. New replies are no longer allowed.