Created
February 20, 2012 19:09
-
-
Save snargledorf/1870781 to your computer and use it in GitHub Desktop.
Scripts for creating a .gitignore using drag and drop.
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
:: To use drag and drop the files/folders you would like to ignore onto the script. | |
:: A .gitignore file will be created in the root directory of the files/folders that you drop on the script | |
:: Ex. I want to hide the file 'C:\myrepo\filetohide.txt' | |
:: When I drop this file onto this script a .gitignore | |
:: file will be created at 'C:\myrepo\.gitignore'. | |
:: Originaly created by Ryan Esteves 1/19/2011 | |
@echo off | |
SETLOCAL ENABLEDELAYEDEXPANSION | |
for %%A in (%*) do (call :sub %%A) | |
goto end | |
:sub | |
set "dir=%~dp1" | |
set "out=%~1" | |
if not ("!out!"=="") ( | |
for %%i in (!out!) do ( | |
if exist %%~si\nul ( | |
set "out=!out!/" | |
) | |
) | |
set "out=!out:%dir%=!" | |
set "out=!out:\=/!" | |
echo !out!>>.gitignore | |
echo !out! added | |
) | |
goto :EOF | |
:end | |
PAUSE |
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
# Coming Soon |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment