1

My project is structure such as

root
  .gitignore
  -src
   - config.ts
  -dist
   - config.js

I have a .gitignore file like this (I am showing just the first 2 lines)

config.ts
config.js

What I see is that config.ts (present the src folder) is actually ignored and not saved on git while config.js (present in the dist folder) is NOT ignored ans is actually saved on git.

Any suggestion on what I am doing wrong?

Picci
  • 16,775
  • 13
  • 70
  • 113

2 Answers2

2

If you want to remove all ignore files form git cache and push it to origin, follow these command:

 git rm -r --cached . 
 git add .
 git commit -m 'Removed all files that are in the .gitignore' 
 git push origin master

Your .gitignore file like this:

dist/config.js
Asif Raza
  • 3,435
  • 2
  • 27
  • 43
1

config.js was probably already tracked by git and should be untracked first:

git rm dist/config.js
Xavier Guihot
  • 54,987
  • 21
  • 291
  • 190