Table of Common Terms used in Git
Below is a list of common terms used in SmartGit, and in Git in general. If you are familiar with other version control systems such as Subversion, note that the meanings of certain terms (e.g. checkout) may have a different meaning when working with Git.
Term | Definition |
---|---|
Bare Repository | A Bare Repository is a Git repository without a Working Tree. Usually, you will want a working directory, so Bare Repositories are generally only of interest to hosting providers like GitHub. Note: A Bare Repository is not the same as an empty repository. |
Branch | A Branch is a named reference to a particular commit in a repository. When new commits are added to a branch, the branch will now point to the later commit. |
Checkout | Checkout (git checkout ) is the Git command to switch between or create new branches. |
Cherry-Pick | Cherry picking (git cherry-pick ) is an advanced feature that pulls a specific, existing commit into the current branch. Although cherry-picking can help pick specific features off side branches into a new release, caution is needed to ensure all dependent commits are cherry-picked in sequentially. |
Clone | Cloning (git clone ) is the command used to create a local copy of an existing repository. |
Commit | Commits (git commit ) is a unit or record of changes made to the files in a repository. So a branch consists of a sequence of commits. |
Commit Hash | A Commit Hash (also known as a commit Id) is a unqiue SHA-1 hash of the contents of a commit, which will be invariably unique (unless the commit data, including timestamps and metadata are all identical). |
Credential Manager | A Git Credential Manager is a secure tool that assists in retaining a user’s credentials as required to access remote repositories. Credential Managers simply provide HTTPS access to remote repositories so that users aren’t prompted for authentication on each git command. Credential Managers play no role for SSH connections. |
Fast Forward | Fast forwarding is a technique Git uses to apply new commits to an existing branch by simply appending each commit to the branch in sequence. e.g., Fast forwarding can be used when pulling changes from a remote branch (if no local changes have been made), or when rebasing a branch from new commits held in a side branch. Fast forwarding has an advantage over squash and merge commits in that no new commits are needed. Fast forwarding cannot happen without new commits in both source and destination branches. |
HTTPS | HyperText Transfer Protocol Secure is an alternative protocol that Git can use to connect local and remote repositories. |
Init | (git init ) is the command to create a new repository. You generally have the option of creating new repositories either on the remote, or locally. If you create the repository locally with a Git Init, you will need to connect to an empty remote repository to push your first commit(s) in your local repository to the remote. |
Local Repository | The local repository is a (clone of a) repository stored on your local system (in the .git folder). You should not make changes to the local repository directly. Instead, you make changes to files in your Working Tree. |
Large File Storage | Git LFS is an extension that stores large binary files (BLOBs) separately from your repositories. This is useful because Git cannot track ‘differences’ between binary files in the same way it can with text files such as source code or wiki documents. Adding BLOBs directly to your Git repository can bloat the storage required and impact performance of commands between local and remote repositories. |
Merge Conflict | A merge conflict occurs when changes are made by different Contributors, on different commits, to the same file, and Git is unable to automaticaly resolve the conflict. This will prevent two branches from being merged together until the conflict has been resolved, and a new commit created on one of the conflicting branches which resolves the conflict. |
Merge Commit | A merge commit is a new commit added when two branches are merged. The log will retain information about both branches, and visualization tools will be able to show commits made on the divergent branches and where they branched off and merged. |
Pull Request | A Pull Request (PR) is a request issued to merge changes made on one branch (e.g., changes made on a feature branch) into another branch (e.g., into a main or release branch). Pull Requests allow an ideal opportunity for code reviews. |
Rebase | Rebasing (git rebase ) provides an alternative to merging two branches by creating or appending equivalent commits representing the changes made in the source branch to the target branch. This removes the appearance of branching from the commit history. In visualization tools, rebased commits appear as a linear sequence of commits on the branch. |
Remote Repository | The repository from which your local repository copy has been cloned. The remote is often referred to as origin by convention. |
Secure Shell (SSH) | SSH is an encrypted network protocol historically used to authenticate and communicate between local and remote repositories. |
Squash Commits | Git allows creating a new, single, consolidated commit from a series of smaller commits, essentially the ‘rewriting’ history in a branch. This can be useful for removing an unnecessarily ‘noisy’ commit history from your repository; however, it has the downside of losing some of the audit trails of when and who made changes. |
Squash Merge | A combination of rebase and squash commit, where the source branch commits are squashed before rebasing onto the target branch |
Staging | Staging is the process of identifying the files (or portions of files) that have been changed (added, edited, or deleted) in your Working Tree and which are to be included in the next commit. Git tracks staged files in the Git index. If you forget to stage a change or newly added file, it will be omitted from the commit! |
Submodules | Submodules allow a common repository (e.g., a library project) to be referenced by one or more ‘parent’ repositories. This enables the reuse of common code without maintaining separate copies of the common repository. |
Tracking Branch | When you checkout a remote branch to your local repository, the local branch will track the remote repository and branch where it originated. As time progresses, this will allow you to merge changes to the tracked branch made by others, into your local branch. |
Trunk Branch | A generic name given to any branch which conceptually is long-lived in a repository, e.g. develop , main or master . Historically, a long lived branch could also be referred to as a ‘main’ branch, however trunk has been used to avoid confusion as the name main is now used as an actual branch name. |
Working Tree | The working tree is the folder on your local system where you can change files in a repository and then stage and commit these changes. |