Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use git-new-workdir on windows?

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?

like image 537
Blowsie Avatar asked Jun 03 '14 13:06

Blowsie


3 Answers

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

like image 81
Blowsie Avatar answered Nov 15 '22 21:11

Blowsie


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.

like image 4
VonC Avatar answered Nov 15 '22 21:11

VonC


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.

like image 1
konsolebox Avatar answered Nov 15 '22 19:11

konsolebox