debian-mirror-gitlab/doc/university/training/topics/git_add.md

41 lines
659 B
Markdown
Raw Normal View History

2018-03-17 18:26:18 +05:30
---
2021-01-29 00:20:46 +05:30
stage: none
group: unassigned
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
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-13 15:44:24 +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-13 15:44:24 +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-13 15:44:24 +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-13 15:44:24 +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-13 15:44:24 +05:30
```shell
2019-10-12 21:52:04 +05:30
git add views/layouts/
```