Last active
December 6, 2015 14:14
-
-
Save bburns/f38c808329529f452233 to your computer and use it in GitHub Desktop.
View and modify the .gitignore file on Windows
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
:: giti | |
:: view and modify .gitignore file | |
:: -------------------------------------------------------------------------------- | |
@echo off | |
rem -h option: show help | |
if "%1" == "-h" ( | |
echo. | |
echo GITI | |
echo View and modify contents of .gitignore | |
echo. | |
echo giti show contents of .gitignore | |
echo giti foo add foo to .gitignore | |
echo giti -e edit .gitignore in editor | |
echo giti -h show help | |
echo. | |
rem no arguments: show file | |
) else if "%1" == "" ( | |
cat .gitignore | |
echo. | |
rem -e option: edit file in editor | |
) else if "%1" == "-e" ( | |
rem . create file if not there? | |
echo Editing .gitignore... | |
%EDITOR% .gitignore | |
cat .gitignore | |
echo. | |
rem otherwise: add filespec to editor | |
) else ( | |
echo Adding %1 to .gitignore... | |
echo %1>>.gitignore | |
cat .gitignore | |
echo. | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment