3 ms·
>a copy of your original directory, with only the modified files actually taking up space What's the use case for this sort of thing?
by ineedasername 5y ago
>a copy of your original directory, with only the modified files actually taking up space
What's the use case for this sort of thing?
- gizmo686 5y agoAt work, we have a codebase that is used by numerous projects. The solution for project specific changes is 'checkout the repo, and make your changes locally'. What that has turned into is 'checkout the repo and make a new directory structure that symlinks everything back to the original'. The keeps the maintenance burden relatively small as you can easily update the base version, and only need to worry about the files you changed. I certainly wouldn't recommend using this approach for anything; but it is not as terrible as it sounds.
- ttyprintk 5y ago‘git worktree’ helps juggling multiple branches.
- archduck 5y agoWhen I need to shuffle around and/or rename my media files, for instance, it's risky to operate on the originals themselves. I've screwed up hundreds of mp3 files by issuing a bad `rename` command. I've lost the hierarchical structures of genres and artists and albums and such by accidentally moving them into the same directory together. And so on. If you `lndir` your mp3 directory to a functional copy of it, a playground of sorts, you can move things around and rename them without having to worry about scenarios like having to listen to a bunch of mp3s in order to put them back to where they're supposed to be. When you're satisfied with the re-organization of your files, you can replace your symlinks with the original files. Since none of the directories are symlinked, you never have to worry about `cd`ing into a place you didn't intend to.
- Phrodo_00 5y agoYou could use hardlinks for this, though (as long as both places are in the same filesystem). Then when you're finishes you just delete the old folder.
- archduck 5y agoHuh. As a hardlink avoider, I never even thought of this. (I don't have a good reason for avoiding hardlinks - it's mainly just because I didn't grok them enough to predict their behavior. When you teach yourself, you gotta expect some gaps!) Thanks for the suggestion.
- ttyprintk 5y agoWhereas ‘cp -Rus’ achieves what lndir can, ‘cp -Rul’ does it with hard links.