Git Tips: Learn the difference between git add --all & git add .

In this article, you will learn the difference between git add -- all and git ad .

The Same:

Both command help you add files into Staging Area.

Tha Difference:

If you use

git add -- all#You will add all the (project) directories into staging area.

If you use

git add .#You will add only the current working directory(including sub-directory) into staging area.

Conclusion:

If you want to add only current working directory(and sub-directory) into staging area, please use “git add .

If you want to add all the (project) directories into staging area, please use “git add --all

For more Git/Github tips, you can check my Git/Github note on this page

Written by

Machine Learning / Deep Learning / Python / Flutter cakeresume.com/yanwei-liu

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store