Skip to content

Instantly share code, notes, and snippets.

@MattHoneycutt
Created October 24, 2014 15:50
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 MattHoneycutt/97342b8f79e1cc378d14 to your computer and use it in GitHub Desktop.
Save MattHoneycutt/97342b8f79e1cc378d14 to your computer and use it in GitHub Desktop.
Create a new git repo with a standard .gitignore
$StandardGitIgnoreFile = Resolve-Path ".\std.gitignore"
function Git-InitStandard() {
git init .
Copy-Item $StandardGitIgnoreFile ".\.gitignore"
Write-Host "Added standard gitignore file."
}
<#
This assumes you have a file next to your Powershell profile (where this function is defined) named std.gitignore. Here's what's in mine:
#ignore thumbnails created by windows
Thumbs.db
#Ignore files build by Visual Studio
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.cache
*.ilk
*.log
[Bb]in
[Dd]ebug*/
*.lib
*.sbr
obj/
[Rr]elease*/
_ReSharper*/
[Tt]est[Rr]esult*
packages/**/
#>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment