Version control on a 2GB USB drive

前端 未结 14 1847
南笙
南笙 2020-12-07 11:30

For my school work, I do a lot of switching computers (from labs to my laptop to the library). I\'d kind of like to put this code under some kind of version control. Of co

14条回答
  •  失恋的感觉
    2020-12-07 12:07

    Darcs is great for this purpose.

    • I can't vouch for other platforms, but on Windows it's just a single executable file which you could keep on the drive.
    • Most importantly, its interactive command line interface is fantastic and very quickly becomes intuitive (I now really miss interactive commits in any VCS which lacks them) - you don't need to memorise many commands as part of your normal workflow either. This is the main reason I use it over git for personal projects.

    Setting up:

    darcs init
    darcs add -r *
    darcs record -am "Initial commit"
    

    Creating a repository on your lab machine:

    darcs get E:\path\to\repos
    

    Checking what you've changed:

    darcs whatsnew      # Show all changed hunks of code
    darcs whatsnew -ls  # List all modified & new files
    

    Interactively creating a new patch from your changes:

    darcs record
    

    Interactively pushing patches to the repository on the drive:

    darcs push
    

    It's known to be slow for large projects, but I've never had any performance issues with the small to medium personal projects I've used it on.

    Since there's no installation required you could even leave out the drive and just grab the darcs binary from the web - if I've forgotten my drive, I pull a copy of the repository I want to work on from the mirror I keep on my webspace, then create and email patches to myself as files:

    darcs get http://example.com/repos/forum/
    # Make changes and record patches
    darcs send -o C:\changes.patch
    

提交回复
热议问题