Ask HN: Merging tools without version control?

4 points by BrS96bVxXBLzf5B ↗ HN
95% of the time I work is spent SSHing into a faster server than my laptop, working with a variety of git repos on there.

5% of the time, there are internet jitters that make this not feasible and I rsync the directory and continue working locally. Sometimes after this I'll end up working again in the repo on the server and so end up with two directories that started at a common point but have diverged.

Ideally I want to do a kind of 'rsync merge', a git merge but just with two directory trees that are close-but-not-quite aligned. I don't want to temporarily create separate parent git repos since the directories themselves already are git repos and that sounds like a confusing recipe for disaster.

Is there any kind of standalone 'git merge'-esque tooling for independent directory trees?

6 comments

[ 2.9 ms ] story [ 32.0 ms ] thread
You might be able to use diff/patch here, like we did in the olden days. They'll work on whole directory trees.

But git is exactly built to solve this problem, and you should be able to do it without temporary parent directories.

Why can't you check your work into a temporary branch on the server, push that branch up to a remote, and then check out that branch locally? Then do your work locally and/or remotely, and then push/pull/merge in all the places and life is good? All just using the existing git repo.

>5% of the time, there are internet jitters that make this not feasible and I rsync the directory and continue working locally. Sometimes after this I'll end up working again in the repo on the server and so end up with two directories that started at a common point but have diverged.

This is not the way to do it. Ideally, you'd git push whatever branch you're working on on the remote server, then git pull on your local workstation. Not rsync. This is a workflow problem, not a tool problem. I knew someone who would copy files from a repo to a temporary directory and work there. That is just not the way to do it.

>Ideally I want to do a kind of 'rsync merge'

I think you want to use git correctly at first and see if the limitations still persist (they won't, they almost never do).

>I don't want to temporarily create separate parent git repos since the directories themselves already are git repos and that sounds like a confusing recipe for disaster.

>Is there any kind of standalone 'git merge'-esque tooling for independent directory trees?

The above is the recipe for disaster. Please consider giving `git` a shot. I work from a location with internet bandwidths at the kbps levels (not kilobytes, kilobits) levels, power outages, and telcos randomly assigning you phone numbers of other people. This is one reason that drove us to create our machine learning (ML) platform in the first place (because we needed to launch ML training jobs that consumed data of data and we simply could not be downloading and we considered at some point having someone fly with a disk with 60 GB of data - not terabyte, just gigabytes, to tell you how much it sucked-). We also had users with 5 kbps (again, five kilobits per second, not five kilobytes per second) connections so I'm more intimately familiar with this issue than I'd ever want to be.

No. Normally I work on game or web projects where I will have a number of WIP progress fixes at once and will separate them into atomic commits at the time I'm happy with them. Creating a bunch of temporary branches with multiple WIPs, or worse, having to unexpectedly take the time to organise the state of those WIPs because of an unexpected internet shake is not productive. rsync and continuing means being able to immediately carry on with issues at hand.

I use git correctly - at the time of commit. When in work mode on loose files I'm dealing with the code, not the infrastructure around it.

So you never push your work branch which you can fetch on your local workstation?
I do but only when it's in a state I'm happy with (if it's a wip branch I'm still not going to commit something that doesn't compile or I might forget the details of quickly). This usually isn't the case at the random moment there's internet instability.