Skip to content

Instantly share code, notes, and snippets.

@swaters86
Last active March 28, 2024 21:17
Show Gist options
  • Save swaters86/98e10f8806c6e8c1b26be105ae4ebc93 to your computer and use it in GitHub Desktop.
Save swaters86/98e10f8806c6e8c1b26be105ae4ebc93 to your computer and use it in GitHub Desktop.
@echo off
echo Removing DLL files from Git tracking, but keeping them locally...
git rm --cached -r *.dll || echo *.dll files not found, continuing
echo Removing build directories from Git tracking...
git rm --cached -r [Dd]ebug/ || echo [Dd]ebug/ directory not found, continuing
git rm --cached -r [Dd]ebugPublic/ || echo [Dd]ebugPublic/ directory not found, continuing
git rm --cached -r [Rr]elease/ || echo [Rr]elease/ directory not found, continuing
git rm --cached -r [Rr]eleases/ || echo [Rr]eleases/ directory not found, continuing
git rm --cached -r x64/ || echo x64/ directory not found, continuing
git rm --cached -r x86/ || echo x86/ directory not found, continuing
git rm --cached -r [Ww][Ii][Nn]32/ || echo [Ww][Ii][Nn]32/ directory not found, continuing
git rm --cached -r [Aa][Rr][Mm]/ || echo [Aa][Rr][Mm]/ directory not found, continuing
git rm --cached -r [Aa][Rr][Mm]64/ || echo [Aa][Rr][Mm]64/ directory not found, continuing
git rm --cached -r bld/ || echo bld/ directory not found, continuing
git rm --cached -r [Bb]in/ || echo [Bb]in/ directory not found, continuing
git rm --cached -r [Oo]bj/ || echo [Oo]bj/ directory not found, continuing
git rm --cached -r [Ll]og/ || echo [Ll]og/ directory not found, continuing
git rm --cached -r [Ll]ogs/ || echo [Ll]ogs/ directory not found, continuing
echo Removing other common build artifacts...
git rm --cached -r *.pdb || echo *.pdb files not found, continuing
git rm --cached -r *.exe || echo *.exe files not found, continuing
git rm --cached -r *.log || echo *.log files not found, continuing
git rm --cached -r *.tlog || echo *.tlog files not found, continuing
echo Removing Visual Studio specific directories...
git rm --cached -r .vs/ || echo .vs/ directory not found, continuing
git rm --cached -r _.vs/ || echo _.vs/ directory not found, continuing
echo Done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment