0

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.

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
  • Note that Git never tracks or adds *directories*, only *files*. However, files have names like `path/to/file` in which `path/to/` is literally part of the file's name. Your OS *demands* that Git break this up: it must be a *folder* named `path`, holding a *folder* named `to`, holding a *file* named `file`, not a *file* named `path/to/file`. Git manages this mapping back and forth for you, but as far as Git is concerned, these are files with (forward) slashes in their names. Git will sometimes *summarize* multiple files in a folder by listing the folder name. – torek Feb 01 '22 at 04:30
  • This whole mapping-back-and-forth between files-with-slashes-in-their-names, and folders with files where there no slashes are allowed, can be kind of frustrating. If you keep in mind that Git only *stores* files, and does this mapping, it helps. – torek Feb 01 '22 at 04:32

1 Answers1

0

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"

...
jessehouwing
  • 106,458
  • 22
  • 256
  • 341