Git-SCM (Part 2)
In a previous post, we have seen what Git is and its main characteristics. Now, we’ll go more into detail about its functionality and we’ll see what a usual day working with Git looks like.
But before, some initial concepts:
Repository: A working tree of files and directories which can be versioned, keeping track of every single modification made over the working tree, been able to move forward and backward in its history. Branch: it is an alternative image of the repository, keeping track of its own history of modifications. A repository has a main branch called master, and it can have an undefined number of branches, some of them may be copies of remote branches and the default name for the upstream repository is origin. The current branch of the working copy can be always referenced as HEAD. Commit: it is a concrete state of a branch, containing the modifications made to the entire working tree since the previous commit in the history, as well as author information and timestamps. It can be identified by its SHA hash, but a name or tag can be associated to it in order to make thing easier. Merge: it is the process of integrating changes or commits of two different branches. This integration is automatically carried by Git, if there are no conflicts between commits. Push: the changes committed in a local branch into a remote branch. These are the basic concepts we are going to use in the rest of this post. Now let’s start with the fun!