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 or you can copy the contents of the file directly from and save it locally inside the folder that is added to your Environment PATH.

To download a template from the repository 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)