Learning pathway
Version control with Git
- Overview
- About this pathway
- Introduction to version control
- Setting up Git and GitHub
- Version control using Git
- Collaborating on a project using Git
- License and citation
All materials are free cultural works licensed under a Creative Commons Attribution 4.0 International (CC BY 4.0) license, except where further licensing details are provided.
Share this with:
Setting up Git and GitHub
This is an introduction on how to configure git locally and remotely, and how to use of the internet hosting service GitHub.
Git is a tool for version control: it keeps track of changes for us, effectively creating different versions of our files. It allows us to decide which changes will be made to the next version, and keeps useful information about them. The complete history of the changes for a particular project can be kept in synchronice way across different computers, facilitating collaboration among different people.
Learning outcomes
After this module you should be able to:
- Set up a repository locally and remotely
- Configure local and remote git
Setting up Git
Introduction on how to configure git the first time on a new computer and how to create a repository on a local computer and connected commands.
- Configure
git
the first time it is used on a computer. - Understand the meaning of the
--global
configuration flag.
Setting up Git
10483
More information about this resourceRemote Git - GitHub
Systems like Git allow us to exchange work between any two repositories. One copy of the repository can be hosted by a central hub, in place of on someone’s laptop. In this module we focus on how to create a remote repository on GitHub.
In general, when you build a remote repository that will be connected to a local repository, it is necessary that the remote repository is empty. That is “Initialize the repository with a README” unchecked, and keep “None” as options for both “Add .gitignore” and “Add a license.”
Set up Git to manage your GitHub repositories from your computer.
Remote Git - GitHub
10485
More information about this resourceHosting
The most common internet hosting services are GitHub, Bitbucket or GitLab. Note each hosting services may have a recommend web-browser.
To connect to a remote repository, a user needs to set up a way for the local computer to authenticate with the hosting services, so the service knows that it’s the correct user trying to connect to his/her remote repository. This can be done for example using Secure Shell Protocol.
Explain different options for hosting scientific work.