[bash] $ git add sort.c
# adds file to staging area
[bash] $ git commit -m "Added sort operation"
# Second commit
[bash] $ git add search.c
# adds file to staging area
[bash] $ git commit -m "Added search operation"
Blob stands for Binary Large Object. Each version of a file is represented by blob. A blob contains file data but does not contain any file metadata. It is a binary file, and in the Git database, it is placed on the SHA1 hash of the file. In Git, files are not set by name. Everything is addressed by content.
Tree is an object, which represents a directory. It keeps blobs as well as other subfolders. A tree is a binary file that holds things related to blobs and trees that are also named SHA1 hash of the tree object.
Commit operation keeps the current state of the repository. A commit is also named SHA1 hash. You can consider a commit object as a node of the linked list. Each commit object has a pointer to the original commit object. From a given commit, you can go back by looking at the original cursor point to see the history of that commit. If a commit has multiple original commits, then the specific commits will be created by merging the two branches.
Branches are used to create other routes of development. By default, Git has a master branch, which is similar to trunk in Subversion. Usually, a branch is created to work on a new point. Once this point is completed, it is merged with the branch and we delete that branch. Each branch is implied by HEAD, which points to the latest commit in the branch. Whenever you make a commit, HEAD is updated by the latest commits.
Tags indicate a meaningful name with a specific version in the repository. Forms are similar to branches, but the difference is that the tags cannot be changed. It means, tags are a branch, but no one intends to fix them. Once a tag is created for specific commits, even if you create a new commit, it will not be updated. Typically, developers create tags for product publication.
Simulation operation creates a copy of the repository. The user can perform many operations with the local repository. This is the time when the internet network needs to be active when the repository instances are being synchronized from the remote repository.
Pull operation copies changes from a remote instance repository (git server) to the local repository. This operation is used to synchronize between two repository instances. This is similar to update operation in Subversion.
Push (push) operation copies changes from local repository to a remote repository (on git server). It is used to save changes permanently in Git repository. It is similar to commit operation in Subversion.
HEAD is a pointer, which usually points to the latest commit in the branch. Whenever you make a commit, HEAD is updated with the latest commit. The heads of branches are stored in .git / refs / heads / directory.
[CentOS] $ ls -1 .git / refs / heads /
master
[CentOS] $ cat .git / refs / heads / master
570837e7d58fa4bccd86cb575d884502188b0c49
Revision represents the version of a source code. Revisions in Git are represented by commits. These commits are determined by SHA1 secure hash.
URL represents the location of the Git repository. Git URL is kept in a config file.
[tom @ CentOS tom_repo] $ pwd
/ home / tom / tom_repo
[tom @ CentOS tom_repo] $ cat .git / config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = gituser@git.server.com: project.git
fetch = + refs / heads / *: refs / remotes / origin / *
According to Tutorialspoint
Previous article: Math function available in Shell
Next lesson: Git environment installation