I am currently learning GIT and trying to create some web projects using it.
However I am not sure how to make proper commits when creating a new file:
e.g. I made the initial commit and then added index.js to my working directory.
Should I commit this empty file as "Index.js is created"? Like is it enough change to make a whole commit?
Will appreciate your help a lot!
CodePudding user response:
I would answer your question with "no". The purpose of making commits is to bundle changes to your application's code in light of working towards a feature.
The addition of a file is a step towards a new feature, yes, but not a meaningful one.
CodePudding user response:
you have to add that file before committing.
Steps:
- Create index.js file.
- add that file or changes.
- commit that changes with an appropriate message.
- push it to git