3 ms·
Is the author using Google Drive sharing as a substitute for a Git server like Github? > That frees him to modify the code as he sees fit without worrying abo
by lozenge 9y ago
Is the author using Google Drive sharing as a substitute for a Git server like Github?
> That frees him to modify the code as he sees fit without worrying about whether he’s accidentally throwing away my work, making me unhappy.
Git already keeps history!
> I should be able to instantly create another workspace. Currently, syncing everything down from the server takes 10 or 20 seconds
It'll only take a moment with `git clone --shallow` and you can then run `git fetch` in the background.
> The last time I switched branches in Git for this, I accidentally had an unsaved change in my text editor. When I later pressed Cmd-S, it got saved to the wrong branch.
Use a text editor that knows Git. This is unsolvable with a text editor that isn't integrated with your version control.
>
If you want to keep two versions of code, the filesystem already offers a solution. It’s called folders. That makes it easier to switch between them, as easy as minimising a window. It’s hack to have only one folder and copying files back and forth to simulate having multiple folders.
git supports having multiple folders with different versions of your code checked out: https://git-scm.com/docs/git-worktree https://git-scm.com/docs/git-worktree
The entire CPython repository is 300MB (less over the wire thanks to compression) and once it's downloaded, Git can answer just about any query you can think of in under 100ms, or as the author says, "instant". I'll take that over some complicated smart-sync cloud solution any day.
- kartickv 9y agoAuthor here. I have all my Git workspaces in Google Drive, but that's a hack, because I'm using two cloud systems (BitBucket and Drive) together. It would be like editing some Word documents by keeping the intermediate versions in Dropbox but the result in Google Drive. > Git already keeps history! Not for uncommitted changes. Like edits in Google Docs. Being able to go back lets me freely modify the code to try out something else knowing I can easily go back. Without making intermediate commits, branches, a second workspace, or other overhead. > This is unsolvable with a text editor that isn't integrated with your version control. Actually it's solvable, by having different workspaces instead of branches when I want to try out two different approaches to see which one works better. Thanks for suggesting worktrees, but given Git's complexity and poor UX, I try not to get too fancy :) But you're right that does work instantly. I'd like instant performance + easy UX.
- Terretta 9y agohttps://codenvy.com https://codenvy.com