May 2017
Beginner
552 pages
28h 47m
English
The git add command adds a change in your working code to the staging area. It does not change the repository, it just marks this change as one to be included with the next commit:
$ vim SomeFile.sh
$ git add SomeFile.sh
Doing a git add after every edit session is a good policy if you want to be certain you don't accidently leave out a change when you commit your changes.
You can also add new files to your repository with the git add command:
$ echo "my test file" >testfile.txt
$ git add testfile.txt
Alternatively, you can add multiple files:
$ git add *.c
The git commit command commits the changes to the repository:
$ vim OtherFile.sh
$ git add OtherFile.sh
$ git commit
The git commit command will open the editor ...