Version Control with Git
Git Cheatsheets for Quick Reference
- Printable Git cheatsheets in several languages are available here (English version). More material is available from the GitHub training website.
- An interactive one-page visualisation about the relationships between workspace, staging area, local repository, upstream repository, and the commands associated with each (with explanations).
- Both resources are also available in other languages (e.g. Spanish, French, and more).
- “Happy Git and GitHub for the useR” is an accessible, free online book by Jenny Bryan on how to setup and use Git and GitHub with specific references on the integration of Git with RStudio and working with Git in R.
- Open Scientific Code using Git and GitHub - A collection of explanations and short practical exercises to help researchers learn more about version control and open source software.
Glossary
- branch
- A Git branch is a pointer to a commit. Branches are used to develop changes in parallel, isolated from each other.
- Centralised Version Control System
- In a Centralised Version Control System such as Subversion a single, centralised server contains the main copy of a repository. Working on code requires internet access to the centralised server.
- changeset
- A group of changes to one or more files that are or will be added to a single commit in a version control repository.
- commit
- To record the current state of a set of files (a changeset) in a version control repository. As a noun, the result of committing, i.e. a recorded changeset in a repository. If a commit contains changes to multiple files, all of the changes are recorded together.
- conflict
- A change made by one user of a version control system that is incompatible with changes made by other users. Helping users resolve conflicts is one of version control’s major tasks.
- Distributed Version Control System
- In a Distributed Version Control System such as Git each collaborator has a copy of the entire repository and its history. Working on code does not require internet access and there are multiple backups of the entire repository.
- Git
- Git is a free and open source Version Control System (VCS) capable of tracking the history of our files and recover previous versions. Git is an example of a Distributed Version Control System.
- GitHub
- GitHub is a cloud-based platform where you can store, share, and work together with others to write code. GitHub is built upon Git.
- HTTP
- The Hypertext Transfer Protocol used for sharing web pages and other data on the World Wide Web.
- merge
- (a repository): To reconcile two sets of changes to a repository.
- protocol
- A set of rules that define how one computer communicates with another. Common protocols on the Internet include HTTP and SSH.
- remote
- (of a repository) A version control repository connected to another, in such way that both can be kept in sync exchanging commits.
- repository
- A storage area where a version control system stores the full history of commits of a project and information about who changed what, when.
- resolve
- To eliminate the conflicts between two or more incompatible changes to a file or set of files being managed by a version control system.
- revision
- A synonym for commit.
- SHA-1
- SHA-1 hashes is what Git uses to compute identifiers, including for commits. To compute these, Git uses not only the actual change of a commit, but also its metadata (such as date, author, message), including the identifiers of all commits of preceding changes. This makes Git commit IDs virtually unique. I.e., the likelihood that two commits made independently, even of the same change, receive the same ID is exceedingly small.
- SSH
- The Secure Shell protocol used for secure communication between computers.
- timestamp
- A record of when a particular event occurred.
- Version Control System (VCS)
- A tool for managing changes to a set of files. Each set of changes creates a new commit of the files; the version control system allows users to recover old commits reliably, and helps manage conflicting changes made by different users.