Difference between git add -A and git add command

0 votes

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,210 points
105 views

1 answer to this question.

0 votes

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,300 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
7,678 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
4,986 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,330 points
1,587 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,620 points

closed Nov 25, 2019 by Sirajul 348 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
1,288 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,300 points
148 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,300 points
155 views