DEV Community

Discussion on: Git basics: Ignore files from being committed

Collapse
 
gitkat profile image
GitKat

Thanks. but I have a question. There is a situation where ive tried and failed before that sometimes I commit the whole project which is fine but during the development process I want to add some files in the .gitignore which does not work. I searched around google and found that I have to go to repository and delete that file from there first and then add it to the .gitignore. and also if I discard the file in the "changes" it discards my file which is frustrating. so I keep it unchecked and keep it in the "changes" list. I work on home pc, office pc and server pc so 3 of them have 3 config files which cause conflict.

Collapse
 
dailydevtips1 profile image
Chris Bongers

Got you, it happens and is very annoying indeed.
Got a article coming up about removing files from git in a couple of days.

You'll have to use the git rm command to remove files after adding them to the gitignore file is what it comes down to :)

You can always hit me up on DM if you need assistance, happy to help 🎉

Collapse
 
gitkat profile image
GitKat

I use GitHub Desktop