Skip to content
Snippets Groups Projects
Commit 8a8b7373 authored by Laurent Heirendt's avatar Laurent Heirendt :airplane:
Browse files

Merge branch 'training-jan24-2019' into 'develop'

Draft of training slides for January 24th, 2019

See merge request R3.training/git.slides!30
parents a6f61b35 c611bc80
No related branches found
No related tags found
No related merge requests found
index.html
package-lock.json
dist/
public/
node_modules
node_modules/
dist
*.log
.sass-cache
......
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Basic git training</title>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="bower_components/reveal.js/css/reveal.min.css">
<link rel="stylesheet" href="bower_components/reveal.js/css/theme/lcsb.css" id="theme">
<link rel="stylesheet" href="css/style.css">
<!-- For syntax highlighting -->
<link rel="stylesheet" href="bower_components/reveal.js/lib/css/zenburn.css" id="highlight-theme">
<!-- If the query includes 'print-pdf', use the PDF print sheet -->
<script>
document.write( '<link rel="stylesheet" href="bower_components/reveal.js/css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
</head>
<body>
<div class="reveal">
<div class="slides">
<section data-separator="^\n\n\n"
data-vertical="^\n\n"
data-background="img/sbgBackgroundWhite.jpg" data-markdown="slides/index.md"></section>
<section data-separator="^\n\n\n"
data-vertical="^\n\n"
data-background="img/whiteBG.jpg" data-markdown="slides/overview.md"></section>
<section data-separator="^\n\n\n"
data-vertical="^\n\n"
data-background="img/whiteBG.jpg" data-markdown="slides/the_terminal.md"></section>
<section data-separator="^\n\n\n"
data-vertical="^\n\n"
data-background="img/whiteBG.jpg" data-markdown="slides/what_is_git.md"></section>
<section data-separator="^\n\n\n"
data-vertical="^\n\n"
data-background="img/whiteBG.jpg" data-markdown="slides/installation.md"></section>
<section data-separator="^\n\n\n"
data-vertical="^\n\n"
data-background="img/whiteBG.jpg" data-markdown="slides/essential_commands.md"></section>
<section data-separator="^\n\n\n"
data-vertical="^\n\n"
data-background="img/whiteBG.jpg" data-markdown="slides/github_gitlab.md"></section>
<section data-separator="^\n\n\n"
data-vertical="^\n\n"
data-background="img/whiteBG.jpg" data-markdown="slides/branches.md"></section>
<section data-separator="^\n\n\n"
data-vertical="^\n\n"
data-background="img/whiteBG.jpg" data-markdown="slides/best_practices.md"></section>
<section data-separator="^\n\n\n"
data-vertical="^\n\n"
data-background="img/whiteBG.jpg" data-markdown="slides/thanks.md"></section>
</div>
</div>
<script src="bower_components/reveal.js/lib/js/head.min.js"></script>
<script src="bower_components/reveal.js/js/reveal.min.js"></script>
<script>
// Configure Reveal
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
fragments: true,
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/fade/none
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'bower_components/reveal.js/lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'bower_components/reveal.js/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'bower_components/reveal.js/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'bower_components/reveal.js/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'bower_components/reveal.js/plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
{ src: 'bower_components/reveal.js/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } },
// { src: 'plugin/search/search.js', async: true, condition: function() { return !!document.body.classList; } }
//{ src: 'bower_components/reveal.js/plugin/remotes/remotes.js', async: true, condition: function() { return !!document.body.classList; } }
{ src: 'js/loadhtmlslides.js', condition: function() { return !!document.querySelector( '[data-html]' ); } }
]
});
</script>
</body>
</html>
## Homework on GitLab
*This exercise has to be done on your lab computer on which `Matlab` **is** installed. Don't forget to properly configure `git` with your username and email, as we explained in the training slides.*
This exercise has to be done on your lab computer on which `Matlab` or `octave` **are** installed.
<div class="fragment">
<br>
During the training, you committed to the
<br>
[https://git-r3lab.uni.lu/git-training/practice](https://git-r3lab.uni.lu/git-training/practice)
repository.
More information on how install these software are on [mathworks.com](www.mathworks.com]) and on [gnu.org/software/octave](gnu.org/software/octave)
<div class="fragment">
<br>
Your task is to create a fork of this repository, commit some code and create a merge request on `GitLab`.
Don't forget to properly configure `git` with your username and email as explained in the training slides.
## Task
- create a fork of the repository <br>https://git-r3lab.uni.lu/R3/R3.practice
- commit some code
- create a merge request on `GitLab`.
## Homework: instructions
- First, fork the [https://git-r3lab.uni.lu/git-training/practice](https://git-r3lab.uni.lu/git-training/practice) repository.
## Detailed instructions
- First, fork the [https://git-r3lab.uni.lu/R3/R3.practice](https://git-r3lab.uni.lu/R3/R3.practice) repository.
- Create the new branch `homework_myName`.
- Implement a new function (create a new file `sqrt_myName.m`) called `sqrt_myName(x)` that computes the square root of `x`.
- Copy the `test.m` file to `test_myName.m` and change the names of the functions accordingly.
- Rename the `test.m` file in the `test/` directory to `test_myName.m`.
- Edit the file `test.m` and change the names of the functions accordingly.
- Before submitting the merge request, verify locally that your code is running properly.
......@@ -32,7 +40,7 @@ Your task is to create a fork of this repository, commit some code and create a
- Create a merge-request.
- Assign either Laurent (@laurent.heirendt) or Sylvain (@sylvain.arreckx) depending on your group and your merge-request will be reviewed by one of us.
- Assign @laurent.heirendt and your merge-request will be reviewed.
<br>
That's it!
slides/img/git_definition.png

31 KiB

slides/img/installation.png

32.8 KiB

......@@ -5,10 +5,11 @@ Absolute Beginners<br>
<img src="img/logoLCSB.png" class="as-is" height="100px">
<br><br><br><br>
<br>
<br><br>
April 12th, 2017
January 24th, 2019
Sylvain Arreckx & Laurent Heirendt
**Laurent Heirendt, Ph.D.**<br>
laurent.heirendt@uni.lu
<br><br><br><br>
......@@ -15,23 +15,19 @@ Install *Xcode Command Line Tools*
<br>
**Windows**
Follow instructions on *[git-for-windows.github.io](https://git-for-windows.github.io)*.
**or:** `MobaXTerm` with `git` plugin: *[mobaxterm.mobatek.net](https://mobaxterm.mobatek.net)*.
<small>More on *[git-scm.com/book/en/v2/Getting-Started-Installing-Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)*</small>
Install Git Bash: <br>`https://git-scm.com/download/win`
## How to start?
**Linux (Ubuntu)** and **macOS**
Start the terminal (or any other shell)
Start the `Terminal` or `iTerm`.
<br>
**Windows**
Start `GUI Bash` or `MobaXTerm`.
Start `GUI Bash`.
## How to configure `git`?
......@@ -62,24 +58,53 @@ $ git config --list
This should list the configuration with `user.name` and `user.email`.
## How to set my SSH key?
Check if you already have an SSH key:
```bash
$ ls -al ~/.ssh
```
If there is a file with an extension `.pub`, you already have an SSH key.
<div class="fragment">
<br><br>
If you don’t have yet an SSH key, you have to generate one:
```bash
$ ssh-keygen -t rsa
```
<br>
Then, add the SSH key to Github/Gitlab (see demo).
## How do I `clone` a repository?
You can clone a repository with
```bash
$ git clone https://github.com/userName/myRepo.git myRepo
$ git clone git@github.com:userName/myRepo.git myRepo
```
<div class="fragment">
<br>
Clone the training repository with
If you did not configure your SSH key, clone using HTTPS:
```bash
$ git clone https://github.com/uni-lu/practice.git practice
$ git clone https://github.com/userName/myRepo.git myRepo
```
<br>
You may be prompted to enter your credentials.
<div class="fragment">
## Clone the practice repository
(Live Demo)
<br>
Clone the training repository! <br><br>
https://git-r3lab.uni.lu/R3.training/git.practice
<div class="fragment">
<br><br>
Any other rudimentary method such as
*'I simply download the `.zip` un unzip it - works like a charm!'*
......
......@@ -17,6 +17,12 @@
"data-background": "img/whiteBG.jpg"
}
},
{
"filename": "the_editor.md",
"attr": {
"data-background": "img/whiteBG.jpg"
}
},
{
"filename": "what_is_git.md",
"attr": {
......@@ -24,19 +30,19 @@
}
},
{
"filename": "installation.md",
"filename": "github_gitlab.md",
"attr": {
"data-background": "img/whiteBG.jpg"
}
},
{
"filename": "essential_commands.md",
"filename": "installation.md",
"attr": {
"data-background": "img/whiteBG.jpg"
}
},
{
"filename": "github_gitlab.md",
"filename": "essential_commands.md",
"attr": {
"data-background": "img/whiteBG.jpg"
}
......@@ -53,6 +59,12 @@
"data-background": "img/whiteBG.jpg"
}
},
{
"filename": "homework.md",
"attr": {
"data-background": "img/whiteBG.jpg"
}
},
{
"filename": "thanks.md",
"attr": {
......
## Overview
0. The Terminal
0. The terminal
1. The editor
1. What is `git`? What is the use of `git`? <!--(5 min)//-->
2. GitHub and GitLab <!--(5min)//-->
3. Installation of `git`
......
## Ready to practice?
<br>Go to https://github.com/uni-lu/group_members
<br>Go to https://git-r3lab.uni.lu/R3.training/git.practice
<br>And follow the instructions in the `README` file.
## The editor
Recommended editors:
- **Visual Studio Code** <br>(https://code.visualstudio.com)
- **Atom** <br>(https://atom.io)
## Visual Studio Code
<br>(Live Demo)
\ No newline at end of file
## The Terminal (shell)
## The terminal (shell)
<br>
**UNIX users (macOS & Linux):**
Start the Terminal from your `/Applications` directoy.
*Pro Tip:* Install iTerm2: <br>`https://www.iterm2.com`
<br>
**Windows users:**
Install Git Bash: <br>`https://git-scm.com/download/win`
<br>
**Linux users:**
Launch default terminal.
*Pro Tip:* Install Terminator: <br>`https://launchpad.net/terminator`
## First steps in the terminal
Starting the terminal presents itself with a line where you can enter a command
```bash
......
......@@ -16,7 +16,7 @@
![](img/git_definition.png)
<br><br>
```
I'm an egotistical bastard, and I name all my projects after myself.
I'm an egotistical bastard, and I name all my projects after myself.
First Linux, now git.
```
Linus Torvald (2007-06-14)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment