2018-03-17 18:26:18 +05:30
|
|
|
---
|
|
|
|
comments: false
|
|
|
|
---
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
# Git Add
|
|
|
|
|
|
|
|
Adds content to the index or staging area.
|
|
|
|
|
2019-03-02 22:35:43 +05:30
|
|
|
- Adds a list of file:
|
2018-11-20 20:47:30 +05:30
|
|
|
|
2020-03-09 13:42:32 +05:30
|
|
|
```shell
|
2019-10-12 21:52:04 +05:30
|
|
|
git add <files>
|
|
|
|
```
|
2018-11-20 20:47:30 +05:30
|
|
|
|
2019-03-02 22:35:43 +05:30
|
|
|
- Adds all files including deleted ones:
|
2018-11-20 20:47:30 +05:30
|
|
|
|
2020-03-09 13:42:32 +05:30
|
|
|
```shell
|
2019-10-12 21:52:04 +05:30
|
|
|
git add -A
|
|
|
|
```
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2019-03-02 22:35:43 +05:30
|
|
|
- Add all text files in current dir:
|
2018-11-20 20:47:30 +05:30
|
|
|
|
2020-03-09 13:42:32 +05:30
|
|
|
```shell
|
2019-10-12 21:52:04 +05:30
|
|
|
git add *.txt
|
|
|
|
```
|
2018-11-20 20:47:30 +05:30
|
|
|
|
2019-03-02 22:35:43 +05:30
|
|
|
- Add all text file in the project:
|
2018-11-20 20:47:30 +05:30
|
|
|
|
2020-03-09 13:42:32 +05:30
|
|
|
```shell
|
2019-10-12 21:52:04 +05:30
|
|
|
git add "*.txt*"
|
|
|
|
```
|
2018-11-20 20:47:30 +05:30
|
|
|
|
2019-03-02 22:35:43 +05:30
|
|
|
- Adds all files in directory:
|
2018-11-20 20:47:30 +05:30
|
|
|
|
2020-03-09 13:42:32 +05:30
|
|
|
```shell
|
2019-10-12 21:52:04 +05:30
|
|
|
git add views/layouts/
|
|
|
|
```
|