DEV Community

Discussion on: Not Committing Frequently Enough? Clone To RAM Disks!

Collapse
 
akorda profile image
akorda

Hi! I prefer to use a slightly different workflow that you may also find useful. I clone a repo on the hard drive and create a new working tree (git-scm.com/docs/git-worktree) to a RAM disk:

sudo mkdir /mnt/workingTrees
sudo mount -t tmpfs -o rw,size=6G tmpfs /mnt/workingTrees
cd ~/dev
git clone github.com/kevin-wayne/algs4.git
cd algs4
git worktree add -b mybranch /mnt/workingTrees/mywt
cd /mnt/workingTrees/mywt
vim README.mkdir
git add .
git commit -m "Update documentation"
cd ~/dev/algs4
git merge mybranch

I hope that you find this helpful!

Collapse
 
joeivansdev profile image
Joe Ivans

Oh man! I loooove worktrees. I've been using git for about a decade now and just found out about them only a few weeks ago.

Thanks for sharing!