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 I commit case-sensitive only filename changes in Git?
- 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?
- How can I recover from an erronous git push -f origin master?
- Link to the issue number on GitHub within a commit message
- Git: list only “untracked” files (also, custom commands)
- 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
- Remove a folder from git tracking
- How to amend a commit without changing commit message (reusing the previous one)?
- How do I git rm a file without deleting it from disk? [duplicate]
- 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