I have a file called sohuku.txt. I have another folder named .gitignore.txt inside which I have put 'sohuku.txt', but when I type 'git add .' in PowerShell and then type git status, it shows the file in changes to be committed. what to do?
Asked
Active
Viewed 300 times
0
-
1Remove the extension from the file `.gitignore`. – ceving Jul 23 '20 at 06:37
-
1Does this answer your question? [How to create a .gitignore file](https://stackoverflow.com/questions/10744305/how-to-create-a-gitignore-file) – stealththeninja Jul 23 '20 at 06:39
5 Answers
2
The .gitignore
file should be at the root of the repository and named properly. https://git-scm.com/docs/gitignore

Anton Belev
- 11,963
- 22
- 70
- 111
2
The file has to be named .gitignore
, not .gitignore.txt
If windows won't let you rename it (an error like "you must type a filename"), then rename it to .gitignore.

dave
- 62,300
- 5
- 72
- 93
2
Don't put .txt
on the .gitignore
file...
So you can pass the file name that you don't want to push to git.

LightCC
- 9,804
- 5
- 52
- 92

Thiago Lopes
- 23
- 3
1
create .gitignore
file in your root /
directory without any extension.
/
src
index.js
.gitignore
want to remove the .txt files, just add in the .gitignore
file
*.txt
and remove the old commit:
$ git reset HEAD~
<< edit files as necessary >>
$ git add ...
$ git commit -c ORIG_HEAD

Ericgit
- 6,089
- 2
- 42
- 53