5 ms·
Does anyone know if there’s a good way to do this in VS Code? I often hold cmd-z until I get to some version and copy code from it. Ideally I’d like to have a s
by thitcanh 6y ago
Does anyone know if there’s a good way to do this in VS Code? I often hold cmd-z until I get to some version and copy code from it. Ideally I’d like to have a separate window where I can see a previous version without affecting the current file/view.
Before anyone comments, git doesn’t cut it for this because no one commits after every -+1
- Mandatum 6y agoLike an ongoing stream of history where I have a slider I can drag to revert on-the-fly.. That'd be cool. I mean you could easily record and do this, but that doesn't copy-paste well. EDIT: And of course I read the article after reading the comments.. Haha, VS Code plug-in in 3.. 2..
- de6u99er 6y agoCommit early, Commit often!
- thitcanh 6y agoIf I have to commit my whole undo history then I’m using git very wrong. I commit (even temporarily) to save progress, but only when it makes sense to so. Sometimes I don’t know whether I’ll need this specific version again in the future.
- de6u99er 6y agoGit doesn't mandate to only commit useful stuff.
- piyush_soni 6y agoBut if there are more people in the team, it will be a great amount of noise they will have to go through before reaching any useful commit. Definitely not recommended.
- bottled_poe 6y agoThis is correct, not sure why you’re getting downvotes. Feature branch for WIP makes sense.
- usefulcat 6y agoThat's still way more overhead compared to undo/redo
- lucideer 6y agoI take it you didn't read the article so.
- uhhhhhhhhhhhhhh 6y agoYou can stage/unstage selected ranges with vscode+git, useful but not a tree. Has bad behavior if you choose some portion of a range, or if the unstage will stomp on some other inflight change
- weaksauce 6y agothis looks like it does that https://github.com/zabel-xyz/local-history https://github.com/zabel-xyz/local-history not super polished nor is it actively maintained but has promise
- MichaelApproved 6y agoHere's the vscode marketplace link for it https://marketplace.visualstudio.com/items?itemName=xyz.local-history https://marketplace.visualstudio.com/items?itemName=xyz.loca... I use it with every project and it works great. Helped me out a bunch of times. Just need to remember to ignore the .history folder from git and other tools.
- shade 6y agoIt might not be exactly what you're looking for, but I saw this linked on Twitter recently and have been meaning to try it out, so maybe worth a look? https://marketplace.visualstudio.com/items?itemName=Wattenberger.footsteps https://marketplace.visualstudio.com/items?itemName=Wattenbe...
- thitcanh 6y agoThis solves another problem I had, so I’ll try it, but it’s completely unrelated to edit history.
- piyush_soni 6y agoDon't know if it serves any other purpose than coloring, but if you want to just go back to the last (and next) edit locations, Visual Studio already has a shortcut for that (Ctrl+Shift+'-' / Ctrl+'-')
- eyelidlessness 6y agoOne thing I think would help this is a dual repo setup with the local dev-only repo automatically committing on save (or if your watch is expensive committing unsaved editor state on pause). The repo could be short lived if you prefer (eg new per baseline repo branch or editing session) or a long lived series of stashes. But its history would be built into the editing experience and separate from the normal version control flow. I don’t think it would necessarily work for everyone but it could certainly fit how I work in exploratory mode without breaking my editing flow.
- piyush_soni 6y agoYeah that is the simple and very effective solution of this whole problem. If I had to use I would use something like this.