Reputation:
I made some changes in my project. When i type git log
i got the next changes:
The question is:
How to delete from this list of changes the file demo.js
? What command should i use?
I want to do this, because i don't want to add all files in my remote repository using the command git add .
.
Upvotes: 0
Views: 36
Reputation: 226
Since it is an untracked file, you can delete it with your regular "file deletion command" of your shell.
In case you want to still keep the file locally on your computer, you are better of by putting it into your .gitignore
file.
Upvotes: 1
Reputation: 64
If you want git not to track those files, add them to .gitignore
:
echo demo.js >> .gitignore
echo test.html >> .gitignore
You can place multiple .gitignore
files anywhere in the repo.
Upvotes: 1
Reputation: 1337
Use this command
git checkout -- <file-path>
<file-path>
can be replaced by .
if all files are to be removed
To remove all changes from demo.js
:
git checkout -- demo.js
Upvotes: 1