{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Why Use Version Control ?\n",
    "\n",
    "- Have you ever been coding on a project that was working, made a change the broke it and weren't able to get back to a working state?\n",
    "\n",
    "- Have you wondered why you made a particular change to your code aboaut a year ago\n",
    "\n",
    "- Is all your analysis and the code only on your laptop which might blow up / get stolen / be left behind somewhere? If you did back it up how long ago was that, could you recreate all the work since then from memory?\n",
    "\n",
    "- In years gone by open source software was distributed as compressed tar archives. Nowadays it is common to point people to a git repository.\n",
    "\n",
    "- A repository enables us to collaborate with others.\n",
    "\n",
    "- Many tools now integrate with version controol tools, e.g. IDEs, Code Review tools, Continuous Integration / Continuous Deployment\n",
    "\n",
    "- You can use a service like [Zenodo](https://zenodo.org/) to register DOIs (citable references) for particular versions of your software\n",
    "\n",
    "![Final.doc](http://swcarpentry.github.io/git-novice/fig/phd101212s.png)\n",
    "*(c)Jorge Cham http://phdcomics.com/*\n",
    "\n",
    "\n",
    "## Using the Terminal in JupyterHub\n",
    "\n",
    "![start-terminal-jupyterhub.png](assets/start-terminal-jupyterhub.png)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Exercises\n",
    "\n",
    "## Exercise 1\n",
    "\n",
    "- Open a new terminal in JupyterHub\n",
    "- Check git is installed\n",
    "- Clone a git repository from the URL https://github.com/githubtraining/example-basic.git "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Answers 1\n",
    "\n",
    "- Check git is installed\n",
    "\n",
    "You can attempt to run it with\n",
    "\n",
    "```\n",
    "git \n",
    "```\n",
    "\n",
    "Or \n",
    "\n",
    "```\n",
    "git --version\n",
    "```\n",
    "\n",
    "- Clone a git repository from the URL \n",
    "\n",
    "```\n",
    "git clone https://github.com/githubtraining/example-basic.git\n",
    "```"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
