简体   繁体   中英

Commit separately specific files inside untracked new directory in git

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.

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"

...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM