Last active
September 11, 2015 17:02
-
-
Save devopsmariocom/fe6edd28bbcdb4c872a5 to your computer and use it in GitHub Desktop.
Checkout workintree from git to parent directory see https://git-scm.com/docs/git-worktree
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CURRENT_WORKTREE_DIR=../worktrees/${PWD##*/} | |
BRANCH=$1 | |
mkdir -p $CURRENT_WORKTREE_DIR | |
git worktree add -b $BRANCH $CURRENT_WORKTREE_DIR/$BRANCH origin/$BRANCH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
run
yourProjectName$ gwtree.sh branchName
and you should find your worktree under ../worktrees/yourProjectName/branchName