wGit is a software that allows you to keep track of changes made to a project over time. Git works by recording the changes you make to a project, storing those changes, then allowing you to reference them as needed.
init means initialize. The command sets up all the tools Git needs to begin tracking changes made to the project.
A Working Directory: where you'll be doing all the work: creating, editing, deleting and organizing files
A Staging Area: where you'll list changes you make to the working directory
A Repository: where Git permanently stores those changes as different versions of the project
Check status of the changes on the working directory.
In order for Git to start tracking the document, the file needs to be added to the staging area.
Since the file is tracked, we can check the differences between the working directory and the staging area with get diff.
The staging area is indicated in white. Changes in the file are indicated in green and marked with a +.
Add the changes to the staging area in Git:
So the changes are saved.
A commit is the last step in our Git workflow. A commit permanently stores changes from the staging area inside the repository.
However, one more bit of code is needed for a commit: the option -m followed by a message:
git commit -m "Complete first line of dialogue"
Often with Git, you'll need to refer back to an earlier version of a project. Commits are stored chronologically in the repository and can be viewed with git log.
A 40-character code, called a SHA, that uniquely identifies the commit. This appears in orange text.
The date and time of the commit
WRAP-UP:
Git is the industry-standard version control system for web developers. Use Git commands to help keep track of changes made to a project:
git init creates a new Git repository.
git status inspects the contents of the working directory and staging area.
git add adds files from the working directory to the staging area.
git diff shows the difference between the working directory and the staging area.
git commit permanently stores file changes from the staging area in the repository.
git log shows a list of all previous commits.