For Git 1.x
$ git add -u
This tells git to automatically stage tracked files — including deleting the previously tracked files.
For Git 2.0
To stage your whole working tree:
$ git add -u :/
To stage just the current path:
$ git add -u .
More Related Contents:
- Removing multiple files from a Git repo that have already been deleted from disk
- Message ‘src refspec master does not match any’ when pushing commits in Git
- Undo git reset –hard with uncommitted files in the staging area
- Recover files that were added to the index but then removed by a git reset
- How to modify existing, unpushed commit messages?
- Remove a file from a Git repository without deleting it from the local filesystem
- Commit only part of a file in Git
- How can I delete a file from a Git repository?
- How do you fix a bad merge, and replay your good commits onto a fixed merge?
- How can I remove a commit on GitHub? [duplicate]
- How do I push amended commit to the remote Git repository?
- Edit the root commit in Git?
- Link to the issue number on GitHub within a commit message
- Git: list only “untracked” files (also, custom commands)
- git add * (asterisk) vs git add . (period)
- git: Your branch is ahead by X commits
- What is a Git commit ID?
- How do I make Git forget about a file that was tracked, but is now in .gitignore?
- What’s the difference between `git add .` and `git add -u`?
- How to change the commit author for a single commit?
- Remove file from latest commit
- How to amend several commits in Git to change author
- How do I make a Git commit in the past?
- Git: How to remove file from index without deleting files from any repository
- Accidentally pushed commit: change git commit message
- How can I undo a `git commit` locally and on a remote after `git push`
- Remove a git commit which has not been pushed
- Xcode 9 commit: Couldn’t communicate with helper application
- Why does ‘git commit’ not save my changes?
- Is it possible to set a git commit to have a timestamp prior to 1970?