+1 vote
1 view
in Devops and Agile by (20k points)

I just did a git init on the root of my new project.

Then I created a .gitignore file.

Now, when I type git status, .gitignore file appears in the list of untracked files. Why is that?

1 Answer

0 votes
by (28.4k points)

In this case, you can have a global user git .gitignore file that will apply automatically to all your repository. This will be useful for IDE and editor files (for instance, swp and *~ files for Vim). Change directory locations to suite your OS

  • Add to your ~/.gitconfig file

[core]

excludesfile = /home/username/.gitignore

You need to create a ~/.gitignore file with file patterns to be ignored

Save your dot files in another repository so you have a backup (optional).

Any time you copy, init or clone a repository your global gitignore file will be used as well.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...