Skip to content

Instantly share code, notes, and snippets.

@FilipDeVos
Forked from tobinharris/.gitignore
Created December 1, 2009 18:04
Show Gist options
  • Save FilipDeVos/246492 to your computer and use it in GitHub Desktop.
Save FilipDeVos/246492 to your computer and use it in GitHub Desktop.
Standard .gitignore file & transform script for svn global-ignores
# .gitignore for .NET projects
# Thanks to Derick Bailey
# http://www.lostechies.com/blogs/derickbailey/archive/2009/05/18/a-net-c-developer-s-gitignore-file.aspx
# Additional Thanks to
# - Alexey Abramov
# Standard VS.NET and ReSharper Foo
obj
bin
*.csproj.user
*ReSharper*
*resharper*
*.suo
*.cache
*Thumbs.db
# Exclude NuGet packages folder
!nuget.exe #Except for nuget.exe
packages/
# Stylecop things
SourceAnalysisViolations.xml
*.SourceAnalysis
# Other useful stuff
*.bak
*.cache
*.log
*.tmp
*.swp
*.user
_compareTemp
_notes
aspnet_client
httpd.parse.errors
*.webinfo
*.InstallLog
*.InstallState
# NCrunch files
*.crunchproject.local.xml
*.crunchsolution.local.xml
# Office Temp Files
~$*
# If you have a deploy folder
deploy
deploy/*
# Exclude ALL compiled files?
*.dll
*.exe
*.pdb
# Exclude svn folders for the freaks that put a git repo in the root of an svn working copy. (git-svn hates externals...)
.svn
.svn/*
# Exclude vss files
*.*scc
# SQL Server management studio stuff
*.sqlsuo
# Monodevelop excludes
*.usertasks
*.userprefs
# Visual Basic 6 excludes
*.vbw
# ###################################################################################
# Powershell script to transform the .gitignore config to be subversion compatible and
# apply it to the subversion global-ignores configuration.
#
# Author: Filip De Vos
# Last updated: 3 Oct 2011
#
# License: WTFPL
#
# Compatibility: Tested on Windows 7 with 'powershell apply_to_svn_config.ps1'
#
# to use this script just call it from the same folder as your .gitignore file.
# If you don't like specifying the full path to the script you need to enable
# the executionpolicy remotesigned
#
# Notes: This script is very naive because I totally stink at powershell scripting.
#
# ###################################################################################
$content = get-content .gitignore | Where-Object {$_ -notlike '#*'}
$line = [string]::join(" ", $content)
$path = $env:USERPROFILE + "\AppData\Roaming\Subversion\config"
(Get-Content ($path)) | Foreach-Object {$_ -replace '^global-ignores = .*$', ("global-ignores = " + $line)} | Set-Content ($path)
#!/bin/sh
# ###################################################################################
# Shell script to transform the .gitignore config to be subversion compatible and
# apply it to the subversion global-ignores configuration.
#
# Author: Filip De Vos
# Last updated: Jan 26 2010
#
# License: WTFPL
#
# Compatibility: Tested on Windows 7 from the msysgit bash shell.
#
# to use this script just call it from the same folder as your .gitignore file
# you might have to make it executable with chmod +x apply_to_svn_config.sh
#
# Notes: This script is very naive because I totally stink at bash scripting.
#
# ###################################################################################
sed "s%^.*global-ignores =.*%global-ignores = .git `cat .gitignore | sed -e "/^#/d" | tr '\r\n' ' '`%g" ~/.subversion/config > updated_config
cp updated_config ~/.subversion/config
sed "s%^.*global-ignores =.*%global-ignores = .git `cat .gitignore | sed -e "/^#/d" | tr '\r\n' ' '`%g" ~/AppData/Roaming/Subversion/config > updated_config
cp updated_config ~/AppData/Roaming/Subversion/config
rm updated_config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment