Difference between git add -A and git add command

+1 vote

Hi Guys,

I am new to Git. I am confused between git add -A and git add . command. Can anyone explain when to use these two commands?

Dec 22, 2020 in Git & GitHub by akhtar
• 38,260 points
7,675 views

1 answer to this question.

+1 vote

Hi@akhtar,

The difference lies in which files get added. git add -A command will add all modified and untracked files in the entire repository.

Whereas git add . will only add modified and untracked files in the current directory and any sub-directories. If you are at the root of the repo, they have the same effect. The difference becomes clear if you are one or more levels below the root.

answered Dec 22, 2020 by MD
• 95,460 points

Related Questions In Git & GitHub

0 votes
3 answers

difference between git remote and git clone

HI.... GIT REMOTE add just creates an entry in ...READ MORE

answered Jul 11, 2020 in Git & GitHub by anonymous
23,569 views
+1 vote
1 answer

difference between git fetch and git pull

Both fetch and pull are used to ...READ MORE

answered Jun 27, 2018 in Git & GitHub by anonymous
6,338 views
0 votes
2 answers

What's the difference between git push and git commit?

I installed ubuntu on vagrant and gave ...READ MORE

answered Jan 3, 2019 in Git & GitHub by Ali
• 11,360 points
3,522 views
0 votes
0 answers

Difference between git rebase and git merge? Which among them is better to use?

Difference between git rebase and git merge? ...READ MORE

Nov 25, 2019 in Git & GitHub by anonymous
• 19,610 points

closed Nov 25, 2019 by Sirajul 1,000 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,062 views
+2 votes
1 answer
0 votes
1 answer

Implement automation between Git and GitHub.

Hi@akhtar, Every Git repository has a .git/hooks folder with a ...READ MORE

answered May 4, 2020 in Git & GitHub by MD
• 95,460 points
991 views
0 votes
1 answer

How to add an empty directory to a Git repository?

Hi@akhtar, A popular solution is to simply add ...READ MORE

answered Oct 5, 2020 in Git & GitHub by MD
• 95,460 points
1,143 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP