dotnet new gitignore

Dotnet core framework ile geliştirdiğimiz projelere .gitignore dosyası ekleyebiliyoruz.

Bu dosya ile eğer projemizde git versiyon kontrol sistemini kullanmışsak, versiyonlamaya tabi olmayacak dosya ve dizinleri tanımlayabiliyoruz.

Şablon sayesinde dotnet projeleri için varsayılan, versiyonlamaya alınmayacak tanımlamalar otomatik olarak geliyor.

Şimdi komutumuzu --help opsiyonu ile inceleyelim.

dotnet new gitignore --help

Komutu girdiğimizde karşımıza aşağıdaki gibi bir çıktı geliyor. Şimdi kullanacağımız opsiyonlara bakalım. Bunlar name ve output olacak.

--name opsiyonu ile dosyaya verilecek ismi (ismi .gitignore olarak kalmalı),

--output opsiyonu ile dosyanın oluşacağı dizinin yolunu belirleyebiliyoruz.

eg@debian:~$ dotnet new gitignore --help
dotnet gitignore file
Author: Microsoft
Description: Creates a gitignore file for a dotnet project.

Usage:
  dotnet new gitignore [options] [template options]

Options:
  -n, --name <name>      The name for the output being created. If no name is specified, the name of the output directory is used.
  -o, --output <output>  Location to place the generated output.
  --dry-run              Displays a summary of what would happen if the given command line were run if it would result in a template creation.
  --force                Forces content to be generated even if it would change existing files.
  --no-update-check      Disables checking for the template package updates when instantiating a template.
  --project <project>    The project that should be used for context evaluation.
  --type <item>          Specifies the template type to instantiate.

Template options:
   (No options)

dotnet new gitignore --name <gitignore_file_name> --output <output_directory>

Aşağıdaki çıktıdaki gibi komutu girdiğimizde .gitignore adında /home/eg/Data/DotnetCliExamples/ExampleSolution dizininde bir .gitignore dosyası oluşmuş oluyor.

eg@debian:~$ dotnet new gitignore --name .gitignore --output /home/eg/Data/DotnetCliExamples/ExampleSolution
The template "dotnet gitignore file" was created successfully.

Last updated