3 ms·
i always heard it fucks up with git repos?
by greenie_beans 3y ago
i always heard it fucks up with git repos?
- generalizations 3y agoI have an entire folder dedicated to various git repos...only thing it doesn't like (so far...) is some compilation artifacts. IDK why.
- prophesi 3y agoI would make sure that there's a `.stignore` file that's identical to your `.gitignore` (except for secret keys/configs you'd like to sync on your devices) in each of those repositories.
- Joeri 3y agoYou can also make a global one for an entire shared folder. For example, I wildcard all node_modules folders as excluded.
- sveinugu 3y agoYeah, you need to add .git to the ignores. Works very well when you have only one repo checked out, for instance to auto-sync a deployment while you type, without having to commit and do CI/CD. With more than one repo you should be sure they are all on the same branch/commit before you sync. If not, you typically get a mess that requires some git-foo to clean up!
- mike-cardwell 3y agoI use it to store most of my private git repos and have been doing so for years now without a single issue. I do this: cd ~/Sync/git mkdir reponame cd reponame git init --bare cd ~/work git clone ~/Sync/git/reponame I guess this could break if I do a push and then shut my laptop lid before it syncs, and then do some more work on my desktop, push, and then go back to my laptop. That hasn't happened though. If it did, it should be trivial to fix. There was some other comment near here about ignoring .git directories. I guess they're using it to store the working directory rather than just the repository, as there is no .git directory stored in ~/Sync/ in my situation.
- karlicoss 3y agonot sure what happens if you commit on two devices before syncing, but the "worst" that happened to me is I get an index conflict, in which case it's easily fixed by 'git reset'
- vulcan01 3y agoFWIW, I've been using syncthing for 3 years now and have never had any issues with git repo syncs.