Home > Net >  Should I make separated commits for an every creation of a new file in working directory (e.g. style
Should I make separated commits for an every creation of a new file in working directory (e.g. style

Time:10-01

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:

  1. Create index.js file.
  2. add that file or changes.
  3. commit that changes with an appropriate message.
  4. push it to git
  •  Tags:  
  • git
  • Related