I started to version control a directory as follows.
git init
git add .
Then, I made modifications, adding/deleting/changing files. After I'm done with that, I run
git status
to get the following results.
# (use "git add/rm ..." to update what will be committed) # (use "git checkout -- ..." to discard changes in working directory) # # deleted: bash/_bash_profile # deleted: bash/_bashrc # modified: functions.sh # modified: readme.txt # # Untracked files: # (use "git add ..." to include in what will be committed) # # bash/bash/ # template/
Now, I can do exactly what 'git status' told me to do.
For deleted file run git rm.
- git rm bash/bash_profile
For modified/added file run git add
- git add functions.sh
My question is this : how can I automatize this? I see that git already knows what action to do on the modified files.
- Is there a git command to do staging every necessary file according to its status? (remove or add)
- If not, is there any easy way to staging all the files instead of running 'git add' or 'git rm' one by one?