Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git removing deleted files from tracking

Tags:

git

I'm new to Git so please bear with me. I initialized my repository and used 'git add .'

What happens if I delete a file and commit? Do I need to reuse 'git add .'? How do I ensure that when I push to master on github, the deleted file won't be there?

like image 777
Delos Chang Avatar asked Dec 27 '22 02:12

Delos Chang


1 Answers

Use git rm to delete a file and make Git recognize the deletion.

git rm path/to/file
git commit
git push
like image 173
Amber Avatar answered Jan 08 '23 12:01

Amber