Add stage files

This commit is contained in:
Isabelle Viktoria Maciohsek
2021-04-06 16:39:37 +03:00
parent 167ef23d3e
commit 81b0c17a6a

24
snippets/stage-files.md Normal file
View File

@ -0,0 +1,24 @@
---
title: Add files to the staging area
tags: commit,beginner
---
Adds files to the staging area.
- Use `git add <pathspec>` to add files to the staging area.
- `<patcspec>` can be a filename or a fileglob.
```sh
git add <pathspec>
```
```sh
git add "30seconds.txt"
# Add the file `30seconds.txt` to the staging area
git add src/*.json
# Add all files with a `.json` extension in the `src` directory
git add .
# Adds all changes to the staging area
```