Commit separately specific files inside untracked new directory in git

70 Views Asked by At

I have a new created directory "supplier_directory", in which there are 3 new files. I need to add these files into different commits.

  1. Commit N1 : file1 only
  2. Commit N2 : file2 and file3

I'm having the following:

supplier_directory

when trying:

git status

I'm enable to add or show changes of certain files inside this untracked and new directory evenly when running 'git status' inside it.

1

There are 1 best solutions below

0
jessehouwing On

Stage/add the files one by one or in groups, committing after each change.

git add file1
git commit -m "adds file 1"
git add file2 file3
git commit -m "adds file 2 and 3"

...