diff --git a/snippets/stage-files.md b/snippets/stage-files.md new file mode 100644 index 000000000..d168836e8 --- /dev/null +++ b/snippets/stage-files.md @@ -0,0 +1,24 @@ +--- +title: Add files to the staging area +tags: commit,beginner +--- + +Adds files to the staging area. + +- Use `git add ` to add files to the staging area. +- `` can be a filename or a fileglob. + +```sh +git add +``` + +```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 +```