Here is a list of commands for files in git and explanations for them:
-
View the status of files in the current branch (to check which files are modified / added / deleted):
git status // or git st for short -
File change statistics (how many lines were added / deleted, in which file):
git log stat -
View changes in the branch files compared to the last commit:
git diff -
Add a file to the stage. Instead of
addresscompletely copy the file address (it can be found by entering the commandgit statusorgit st):git add addressTo add several files at once that are located in one folder you can specify the address of their common folder with the characters
/*at the end. To add all files with the same extension, you can instead ofaddressjust specify their extension - for example.txt. -
Remove a file from the stage. Instead of
addresscompletely copy the file address as it was described above. The file will be removed from the stage, but the changes made in it will remain:git reset HEAD address -
Undo file changes (roll it back to its original state). Instead of
addresscompletely copy the file address as it was described above:git checkout address // or git co address for short