|
Stage updates to tracked files only:
- Use
git add -u to stage only updates to files that are already tracked:
will stage modified & deleted files
Does not stage new untracked files
- This is helpful when you want to commit your edits, but still exclude new files you're not ready to commit yet
|
$ git status
On branch main
Your branch is up to date with 'origin/main'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: train.py
Untracked files:
(use "git add <file>..." to include in what will be committed)
dataset.py
no changes added to commit (use "git add" and/or "git commit -a")
$ git add -u
$ git status
On branch main
Your branch is up to date with 'origin/main'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: train.py
Untracked files:
(use "git add <file>..." to include in what will be committed)
dataset.py
|