2017-11-01 11:56:40 -04:00
|
|
|
---
|
|
|
|
comments: false
|
|
|
|
---
|
|
|
|
|
2016-10-20 06:38:32 -04:00
|
|
|
# Git Add
|
|
|
|
|
|
|
|
Adds content to the index or staging area.
|
|
|
|
|
2018-11-13 01:07:16 -05:00
|
|
|
- Adds a list of file:
|
2018-09-06 12:52:18 -04:00
|
|
|
|
2020-01-30 10:09:15 -05:00
|
|
|
```shell
|
2019-07-31 06:29:10 -04:00
|
|
|
git add <files>
|
|
|
|
```
|
2018-09-06 12:52:18 -04:00
|
|
|
|
2018-11-13 01:07:16 -05:00
|
|
|
- Adds all files including deleted ones:
|
2018-09-06 12:52:18 -04:00
|
|
|
|
2020-01-30 10:09:15 -05:00
|
|
|
```shell
|
2019-07-31 06:29:10 -04:00
|
|
|
git add -A
|
|
|
|
```
|
2016-10-20 06:38:32 -04:00
|
|
|
|
2018-11-13 01:07:16 -05:00
|
|
|
- Add all text files in current dir:
|
2018-09-06 12:52:18 -04:00
|
|
|
|
2020-01-30 10:09:15 -05:00
|
|
|
```shell
|
2019-07-31 06:29:10 -04:00
|
|
|
git add *.txt
|
|
|
|
```
|
2018-09-06 12:52:18 -04:00
|
|
|
|
2018-11-13 01:07:16 -05:00
|
|
|
- Add all text file in the project:
|
2018-09-06 12:52:18 -04:00
|
|
|
|
2020-01-30 10:09:15 -05:00
|
|
|
```shell
|
2019-07-31 06:29:10 -04:00
|
|
|
git add "*.txt*"
|
|
|
|
```
|
2018-09-06 12:52:18 -04:00
|
|
|
|
2018-11-13 01:07:16 -05:00
|
|
|
- Adds all files in directory:
|
2018-09-06 12:52:18 -04:00
|
|
|
|
2020-01-30 10:09:15 -05:00
|
|
|
```shell
|
2019-07-31 06:29:10 -04:00
|
|
|
git add views/layouts/
|
|
|
|
```
|