Git add
Naar navigatie springen
Naar zoeken springen
Use git add
for staging: To add local files to the index. Staging is the first step in the usual git procedure of stage, commit, push.
git add <file>
- Add a specific filegit add .
- Add all files in the current directory that have been changed
Example
After chaning some files locally, let's first check the current status:
$ git status On branch main Your branch is up to date with 'origin/main'. Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) modified: load_site_array.sh modified: read-out-r-figures-dvb8.sql modified: r-sites-dvb8.sh no changes added to commit (use "git add" and/or "git commit -a")
Stage these three files at once - Note that there is no feedback:
$ git add .
and check status again:
$ git status On branch main Your branch is up to date with 'origin/main'. Changes to be committed: (use "git restore --staged <file>..." to unstage) modified: load_site_array.sh modified: read-out-r-figures-dvb8.sql modified: r-sites-dvb8.sh