DEV Community

Senad Meskin
Senad Meskin

Posted on

Powershell script that downloads .gitignore template by name

There is a Github project, if you didn't know about it already, that contains common .gitignore template files for different platforms, IDE-s, Frameworks, Languages, etc.

To get the file by yourself you can:

  • Clone project than copy files that you need
  • Copy contents of the file and create it locally
  • Or use a PowerShell script to download it into the active folder

Download script from repository https://github.com/senad-meskin/powerscripts or you can copy the contents of the file directly from https://raw.githubusercontent.com/senad-meskin/powerscripts/master/git-ignore.ps1 and save it locally inside the folder that is added to your Environment PATH.

To download a template from the repository https://github.com/github/gitignore just call the script and pass template name as the first parameter (Case sensitive)

git-ignore VisualStudio

where VisualStudio is a template name without .gitignore extension from Gitignore repository

List of .gitignore templates

Discussion (0)