I’m not entirely sure why you might want to commit each file individually, but you can selectively commit files by telling Git which ones you want to commit.
Let’s say you’ve got the following:
You can selectively commit files by specifying them to the commit command. If we imagine that I’ve made changes to several of these files, but I only want to commit the changes to
frames.jpeg, I can do this:
git commit -m "style tweak, fixed typo, reduced img file size" index.html style.css frames.jpeg
Git will then only commit the files I specified at the end of the command.
If you’re stuck on how to use any of the commands in Git, it has a pretty comprehensive help system. You can see the help for any command by running
git [command] --help - so for the
commit command, running
git commit --help from the terminal would bring up the relevant help.