Created
November 17, 2011 13:34
-
-
Save timabell/1373142 to your computer and use it in GitHub Desktop.
script to safely remove extra working folders for git in windows
This file contains 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
@echo off | |
REM See: http://timwise.blogspot.com/2011/11/multiple-working-folders-for-git-on.html | |
if not "%1" == "" goto start | |
:usage | |
echo. | |
echo Usage: %0 TARGET | |
echo. | |
echo Removes a git linked working copy, safely removing NTFS symbolic links | |
echo TARGET is the name of the working copy folder you would like removed. | |
goto end | |
:start | |
junction -d "%1"\.git\hooks > NUL | |
junction -d "%1"\.git\info > NUL | |
junction -d "%1"\.git\logs > NUL | |
junction -d "%1"\.git\objects > NUL | |
junction -d "%1"\.git\refs > NUL | |
rmdir /s /q "%1" | |
echo Done. "%1" removed. | |
:end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment