Introduction to Git - ices-taf/doc GitHub Wiki

Git

Git a is free and open-sourced Version Control System (https://git-scm.com/), which as the name implies, is a way to manage different versions of your codebase. Version control is a category of software that keeps track of changes to your files for you. It allows you to:

  • Keep the entire history of a file, you can inspect a file throughout its lifetime (changes log).
  • Tag particular versions so you can go back to them easily, nothing is deleted.
  • Facilitates collaborations and makes contributions transparent, you can see who has made changes and which changes they have made.
  • Gives a team the ability to work on the same code base (master branch) through a well-documented approach (development branches), which allows experimentation with code and features without breaking the main project.
  • Saving (committing) a change in Git creates a permanent snapshot of the file in the Git directory along with a message that indicates what you did to the file.
  • Git notifies you when changes are made – when your local copy is not the same as the remote copy (hosted on GitHub) – no overwriting.
  • Git is accessible via a command line (terminal) in R/R studio, or a desktop app that has a GUI (graphical user interface).

A Git repository is a folder containing all the project files and folders as well as the entire revision history of your project. What this means is, that you take an ordinary folder of files and tell Git to make it a repository. This creates a .git subfolder (hidden), which contains all the Git metadata for tracking changes. A single repository is usually used for a single project (repository = project). You can store your repository locally (on your computer) or on an online hosting facility (e.g. GitHub). With Git, every time you commit, or save the state of your project, it “takes a picture” of what all your files look like at that moment and stores a reference to that snapshot. To be efficient, if files have not changed, Git doesn’t store the file again, just a link to the previous identical file it has already stored. This means that Git considers its data as a stream of snapshots.

To get started with Git: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

GitHub

GitHub is a free website and cloud-based service that helps developers/contributors store and manage their code and other work, as well as track and control the changes to their work. You do not need GitHub to use Git, but you cannot use GitHub to its full potential without using Git, because GitHub is the place where you can host all your Git repositories online to easily collaborate with others and work on projects from many locations at the same time. This makes it easier for you and your team to work on projects together because it is a central place to store codes and files and see document what changes have been done during the lifetime of the repository. To be able to access GitHub repositories from your computer and work in collaboration with colleagues, you will have to use the version control system software, Git. Once you can access an online repository you can manually upload files directly or use Git with your code platform to clone the repository and work with it remotely.

For more information on GitHub and how it can be used https://docs.github.com/en