git worktree
Posted: Sun Oct 30, 2016 5:50 am
Have two+ working trees that both hook into the same repo!
So I just now found this out but git since 2.5 (july 2015 ) has a command that allows you to just make a new working tree and that tree will be linked to the master repo you used the command in.
(From root of current working tree)
This will checkout whatever branch you currently have checked out (by creating a new one based off it) into ../tgstation2 and now you can work on two branches at the same time instead of having to git stash or git commit your changes then reapply them back into the working tree. You can of course do this as many times as you want (providing different directory names silly), and it allows you to work on two or more branches literally at the same time with two dreammaker instances etc, and two versions of the game you can compile and use independently etc etc.
And also it's all linked to the same repo with the same refs (except HEAD and a few others i think). The commands you call are not being called on a cloned repo that is synced with the main repo, but the main repo itself, no hacky workaround methods used.
More info here: https://git-scm.com/docs/git-worktree
I really am very happy I found this and wish I found it way earlier.
So I just now found this out but git since 2.5 (july 2015 ) has a command that allows you to just make a new working tree and that tree will be linked to the master repo you used the command in.
(From root of current working tree)
Code: Select all
git worktree add ../tgstation2
And also it's all linked to the same repo with the same refs (except HEAD and a few others i think). The commands you call are not being called on a cloned repo that is synced with the main repo, but the main repo itself, no hacky workaround methods used.
More info here: https://git-scm.com/docs/git-worktree
I really am very happy I found this and wish I found it way earlier.