-
- Version control is a tool developers use to keep changes across multiple software versions organized.
- git init : Creates an empty git repository.
- git status : Tells you whether you have untracked or modified files not yet in the staging area.
- git add <file> : Adds a file to the staging area. You can add multiple files by listing them (separated by spaces) or add all the files at once by using git add .
- git commit -m “logical set of changes” : Makes a new snapshot of your code, along with any recent changes.
- Commit messages should be short, descriptive, and encompass a logical set of changes.
- git log : Shows all the commit logs.
- git diff <commit_id_1> <commit_id_2> : Shows differences in files between commits.