GitCheatSheet.org logo
Home / How To

Add file or directory to staging

# Add single file
git add file.txt

# Add multiple files
git add file1.txt file2.txt

# Add all text files in current dir
git add *.txt

# Add files in "my-dir"
git add my-dir

Adds files to staging.