0

I have two files in a config directory: local.config and local.config.example I only want local.config.example to be in git and ignore local.config.

I tried the following to .gitignore, but this doesn't seem to work. What am I doing wrong?

local.config
!local.config.example
Flimzy
  • 68,325
  • 15
  • 126
  • 165
Null
  • 21
  • 2

2 Answers2

0

Two Approaches,

  1. Simply add local.config in .gitignore
git status
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    .gitignore
    local.config.example

    cat .gitignore 
    local.config
  1. As mentioned in git ignore exception
Rishabh Dugar
  • 596
  • 4
  • 16
0

Add the path(s) to your file(s) which you would like to ignore to your .gitignore file (and commit them).

Mahan
  • 59
  • 1
  • 8