question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ng new --skip-git/--skipGit should not skip creating .gitignore file

See original GitHub issue

Versions

Angular CLI: 1.5.3                                           @angular/cli: 1.5.3
Node: 8.9.1                                                  @angular-devkit/build-optimizer: 0.0.33
OS: win32 x64                                                @angular-devkit/core: 0.0.21
Angular: 5.0.3                                               @angular-devkit/schematics: 0.0.37
... animations, common, compiler, compiler-cli, core, forms  @ngtools/json-schema: 1.1.0
... http, language-service, platform-browser                 @ngtools/webpack: 1.8.3
... platform-browser-dynamic, router                         @schematics/angular: 0.1.7
                                                             typescript: 2.4.2
Windows 10 x64                                               webpack: 3.8.1

Repro steps

  1. Use ng new --skip-git to create a new project without a Git repository.
  2. Open the project folder and look for .gitignore file.

Observed behavior

The .gitignore file does not exist.

Desired behavior

What would like to see implemented?

The .gitignore file should be generated and added to the project.

What is the use case?

  • Project may be part of a larger project that already has a Git repository.
  • Project may have a Git repository initialized later.

What did you expect to see?

The .gitignore file exists.

Mention any other details that might be useful (optional)

A .gitignore file is still very useful even if no Git repository was initialized. This is because the project may be part of a larger project which already has a Git repository or uses another gitignore-aware VCS. Or a Git repository may be added to the project later. In either case, you do not want all the build files, modules, IDE files, e2e files and whatnot to be checked in to the repository.

For anyone that may never use Git with the project, the .gitignore file is just a small harmless additional file in the project, so it’s not an issue there.

Relates to #4854

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
Executuscommented, Apr 30, 2018

Here’s another use case using VSTS (Visual Studio Online):

  1. Create empty git project in VSTS
  2. Clone git project on client
  3. Create angular app with --skip-git flag, as we don’t want to init a new repo. However we still want the gitignore.
3reactions
NeeLonGithubcommented, Jun 10, 2019

I expect --skip-git to skip the git processes (init and first commit). In my case I just don’t want the first commit to be done with my global settings, so I want to skip the git processes and do them myself later. For an option that expects the project to be oblivious of git and therefore not even create a .gitignore, I would expect --no-git or something similar.

Read more comments on GitHub >

github_iconTop Results From Across the Web

git - How to create a .gitignore file
If you're using Windows, it will not let you create a file without a filename in Windows Explorer. It will give you the...
Read more >
Creating a .gitignore file - How we can use git ... - YouTube
A . gitignore file is a great and simple tool we can use to prevent including unwanted files in a git repository. This...
Read more >
Create a .gitignore
A .gitignore file is a list of files to ignore when pushing files to ... Git will look for a file with that...
Read more >
.gitignore file - ignoring files in Git | Atlassian Git Tutorial
There is no explicit git ignore command: instead the .gitignore file must be edited and committed by hand when you have new files...
Read more >
What is Git-Ignore and How to Use it?
These files are not of any use to anyone else and we do not want to clutter ... Step 2: Create .gitignore File...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found