I made a small replication game called Snake, and it uses a small json database through node express. And right now, I deployed the game to Heroku using git. However, whenever I change index.js or index.html in my public path, and after commit them and git push origin master, it pushes every single file I have in my project. Including all node modules and my json database. There were people's saved scrores on my online json file, but after pushing my index.js, the online json cleared it's content.
So is there any way to only push the commited files? I tried other's solution like to make a new branch and checkout or something but it doesn't work for me. When I created a new branch and checkouted my paths, it tells me I have a bunch of files needed to commit.
Also, when I push everytime, it takes a long time to upload because it is uploading all the node modules everytime.