0

Suppose I have three files, one, two, and three. After initializing git and adding it to a remote repo, I now delete two.txt and modify three.txt. So while adding and committing now I have to do "git rm two.txt" and then go for "git add ."

My question is, do we have a command that can take all changes to staging area? Basically something like "git " that will update everything to stating area instead of manually having to delete.

ElectronicGeek
  • 3,312
  • 2
  • 23
  • 35
vishalmullur
  • 1,094
  • 4
  • 14
  • 32

2 Answers2

2

Use the following command

git add -A

Check out this question:

Difference between "git add -A" and "git add ."

Community
  • 1
  • 1
Ellery
  • 1,356
  • 1
  • 14
  • 22
2

You are looking for:

git add -A

From git 2.0 onwards:

git add .
manojlds
  • 290,304
  • 63
  • 469
  • 417
  • Thanks but I have a followup question. Does it mean that from git 2.0 onward both command do the same? – vishalmullur Jun 28 '14 at 20:29
  • 3
    @VyprNoch - From 2.0 onwards, `"git add " is the same as "git add -A "`. But `git add -A` can be different from `git add .`, as `git add -A` operates on the entire repo, and `git add .`, obviously acts on the current directoy ( and children.) – manojlds Jun 28 '14 at 20:32