![]() ![]() The staging area is the place to store changes in the working tree before the commit. Git implements revisions as commit objects (or short commits ). If a bare repository is referred, this is explicitly mentioned. The term repository typically refers to a non-bare repository. If the repository is not a bare repository, it allows you to checkout revisions into your working tree and to capture changes by creating new commits.īare repositories are only changed by transporting changes from other repositories. In Git each copy of the repository is a complete repository. Index is an alternative term for the staging area.Ī repository contains the history, the different versions over time and all different branches and tags. If you checkout a specific commit, the HEAD points to this commit directly. If you switch branches, the HEAD pointer points to the branch pointer which in turn points to a commit. In that state creation of a commit will not move any branch. Sometimes the HEAD points directly to a commit object, this is called detached HEAD mode. HEAD is a symbolic reference most often pointing to the currently checked out branch. This is common for contributions to open source projects. The author did the change and the committer applied the change to the Git repository. The author and committer might be different people. This makes it possible to identify who did the change. This revision can be retrieved later, for example, if you want to see the source code of an older version.Įach commit object contains the author and the committer. This commit object uniquely identifies a new revision of the content of the repository. ![]() When you commit your changes into a repository this creates a new commit object in the Git repository. The default branch is the one for which a local branch is automatically created when cloning the repository. One of the branches is the default (typically named master ). You can create a new branch from an existing one and change the code independently from other branches. Way a branch defines its own line of descendants in the overall version graph formed by all commits in the repository. Successors are retrieved by traversing the commit graph starting from branches or other refs, symbolic references (for example: HEAD) or explicit commit objects. If you are working in a certain branch, the creation of a new commit advances this pointer to the newly created commit.Įach commit knows its parents (predecessors). Selecting a branch in Git terminology is called to checkout a branch. It is intended to be used as a reference, so you can skip this now and return to it if you need clarification. The following table summarizes important Git terminology. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |