Git Stages

Working directory / Workspace: here we write the code.

Staging area: Adding your code in the staging area. storing your finalize code. here we cannot modify our code.

Local Repo: Where we can commit our code and every code gets its one commit id, so in future we can retrieve our code by its commit id. We can create a snapshot for our code.

Repository: It is a place where you have all your code and a kind of folder related to different work.

Server: It stores all the repositories and metadata.

Commit: Store all the changes in repositories and track all the changes by giving commit id. Commit id contains 40 alpha-numeric characters. It uses the SHA1 checksum concept. For e.g Even if you change one dot in code it gives you a different commit id.

Commit ID/ Version ID/ Version: Reference to identity each change or to identify who changed the file.

Tags: As commit id is too long(40 alpha-numeric characters) everyone could not remember that commit id. So we assign a meaning full name with a specific version in the repository by Tags.

Snapshots: Represent some data for a particular time. It is always incremental and it stores changes only not the entire copy.

Branch: We create a branch to change its code. By creating a branch we can track in which branch what changes have been done.

Merge: We can add our changes in code into main code by using merge.

ADD: When we transfer your code from local directory to staging state, the process is called ADD.

COMMIT: When we transform our code from staging to local repository it is called COMMIT.

PUSH: When we transfer our code from local repo to github it is called PUSH.

PULL: When we want to retrieve code from a different local repo from github it is called PULL.