I have a repo that has two branches, which i would like to work on simultaneously.
After some reading I found git has a script git-new-workdir
.
Im trying run use the script from the git for windows bash but get the following error.
$ git-new-workdir
sh: git-new-workdir: command not found
How do I use this script on windows?
Due to some of the commands in the git-new-workdir
functions not existing on windows, the script won't work.
I have found this windows port of the script. Works great for me.
https://github.com/joero74/git-new-workdir
Git 2.5 (Q2 2015) will replace contrib/workdir/git-new-workdir
with an official native Git command which works on any OS (including Windows).
The release notes mentions:
does not rely on symbolic links and make sharing of objects and refs safer by making the borrowee and borrowers aware of each other.
That is because the multiple working trees are "linked", or actually recorded in the main repo new $GIT_DIR/worktrees
folder.
See "Multiple working directories with Git?" for more.
On my installation, the script file is located in /usr/share/git/contrib/workdir/git-new-workdir
.
Perhaps if it's not installed in that version of git
, you can just download its raw form and run it with bash /path/to/git-new-workdir
. At your preference you can also install it in /usr/local/bin
changing permissions when necessary.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With