Skip to content

Instantly share code, notes, and snippets.

@bburns
Last active December 6, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bburns/f38c808329529f452233 to your computer and use it in GitHub Desktop.
Save bburns/f38c808329529f452233 to your computer and use it in GitHub Desktop.
View and modify the .gitignore file on Windows
:: 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