Git - how to commit manually deleted file?

3 points
Asked by:

How do I commit a file that I manually deleted in my project?

After the git status command I get the following result:

Now I want to commit file2.txt, how can I do this?

1 answer
0 points
Answered by:

Use git rm <fileName> command.

In this case, it would be:

git rm directory2/file2.txt

Then you can commit:

git commit -m "commit message..."
0 comments Add comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂