|
@@ -2,10 +2,10 @@
|
|
marp: true
|
|
marp: true
|
|
title: Version control with git for scientists
|
|
title: Version control with git for scientists
|
|
author: P.Y. Barriat
|
|
author: P.Y. Barriat
|
|
-description: https://dev.to/nikolab/complete-list-of-github-markdown-emoji-markup-5aia
|
|
|
|
|
|
+#description: https://dev.to/nikolab/complete-list-of-github-markdown-emoji-markup-5aia
|
|
backgroundImage: url('assets/back.png')
|
|
backgroundImage: url('assets/back.png')
|
|
_backgroundImage: url('assets/garde.png')
|
|
_backgroundImage: url('assets/garde.png')
|
|
-footer: 05/05/2022 | Version control with Git
|
|
|
|
|
|
+footer: 15/05/2023 | Version control with Git
|
|
_footer: ""
|
|
_footer: ""
|
|
paginate: true
|
|
paginate: true
|
|
_paginate: false
|
|
_paginate: false
|
|
@@ -16,9 +16,9 @@ Version control with `git` for scientists <!--fit-->
|
|
|
|
|
|

|
|

|
|
|
|
|
|
-### PY Barriat & F. Massonnet
|
|
|
|
|
|
+### PY Barriat
|
|
|
|
|
|
-##### May 05, 2022
|
|
|
|
|
|
+##### May 15th, 2023
|
|
|
|
|
|
###### some parts inspired on slides from CISM
|
|
###### some parts inspired on slides from CISM
|
|
|
|
|
|
@@ -136,6 +136,43 @@ Explications
|
|
|
|
|
|
---
|
|
---
|
|
|
|
|
|
|
|
+# Windows : use `git` in VSCode
|
|
|
|
+
|
|
|
|
+[Visual Studio Code](https://code.visualstudio.com/) is one of the most popular and powerful text editors used by software engineers today
|
|
|
|
+
|
|
|
|
+Free and available for [macOS](https://www.youtube.com/watch?v=8CJXB4Nu1wo), [Windows](https://www.youtube.com/watch?v=AdeWO-n9O2Q), and [Linux](https://code.visualstudio.com/Download)
|
|
|
|
+
|
|
|
|
+> Linux: `wget` the **deb** package then `dpkg -i code*.deb`
|
|
|
|
+
|
|
|
|
+## Prerequisite
|
|
|
|
+
|
|
|
|
+To use `git` in VSCode, first make sure you have `git` [installed on your computer](https://git-scm.com/download/win)
|
|
|
|
+> keep everything by default during the install process
|
|
|
|
+
|
|
|
|
+---
|
|
|
|
+
|
|
|
|
+## Configure `git` in VSCode
|
|
|
|
+
|
|
|
|
+- Open Settings (JSON) and add the properties to the end of the page :
|
|
|
|
+
|
|
|
|
+```json
|
|
|
|
+{
|
|
|
|
+ "terminal.integrated.profiles.windows":
|
|
|
|
+ {
|
|
|
|
+ "Git Bash":
|
|
|
|
+ {
|
|
|
|
+ "path":"C:\\Program Files\\Git\\bin\\bash.exe"
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ "terminal.integrated.defaultProfile.windows": "Git Bash"
|
|
|
|
+}
|
|
|
|
+```
|
|
|
|
+
|
|
|
|
+- Reopen VS Code
|
|
|
|
+- Open a new terminal
|
|
|
|
+
|
|
|
|
+---
|
|
|
|
+
|
|
# Getting started with `git`
|
|
# Getting started with `git`
|
|
|
|
|
|
**checkout** a remote repository
|
|
**checkout** a remote repository
|
|
@@ -171,6 +208,21 @@ each snapshot is called **commit** which is :
|
|
|
|
|
|
---
|
|
---
|
|
|
|
|
|
|
|
+Your changes are now in the **HEAD** of your local working copy.
|
|
|
|
+
|
|
|
|
+**push**
|
|
|
|
+>to send those changes to your remote repository
|
|
|
|
+```bash
|
|
|
|
+git push
|
|
|
|
+```
|
|
|
|
+**pull**
|
|
|
|
+>to update your local working directory to the newest commit, to fetch and merge remote changes
|
|
|
|
+```bash
|
|
|
|
+git pull
|
|
|
|
+```
|
|
|
|
+
|
|
|
|
+---
|
|
|
|
+
|
|
# `git` diff
|
|
# `git` diff
|
|
|
|
|
|
```mermaid
|
|
```mermaid
|
|
@@ -204,16 +256,22 @@ sequenceDiagram
|
|
```
|
|
```
|
|
---
|
|
---
|
|
|
|
|
|
-# Windows users
|
|
|
|
-
|
|
|
|
-> How commonly do programmers use Git GUIs instead of the command line ?
|
|
|
|
|
|
+# Simple Git Exercices
|
|
|
|
|
|
-Use programs like `SourceTree` or `TortoiseGit`
|
|
|
|
|
|
+First, configure your environment (just once) :construction:
|
|
|
|
+> on your laptop, on your ELIC account, etc
|
|
|
|
|
|
-
|
|
|
|
|
|
+```bash
|
|
|
|
+git config --global user.name "Your Name"
|
|
|
|
+git config --global user.email "foo@bar.be"
|
|
|
|
+git config --global color.ui auto
|
|
|
|
+git config --global core.editor "vim"
|
|
|
|
|
|
-But, **to be familiar with Git**, try the command line
|
|
|
|
-> clone, push/pull, merge, rebase, log, tag, format-patch/am, bisect, blame, etc
|
|
|
|
|
|
+git config --list
|
|
|
|
+```
|
|
|
|
+Now, clone https://gogs.elic.ucl.ac.be/TECLIM/Git_Training.git
|
|
|
|
+> Theses are very simple exercices to learn to manipulate git.
|
|
|
|
+> In each folder, simply run `./create.sh` and follow the guide :sunglasses:
|
|
|
|
|
|
---
|
|
---
|
|
|
|
|
|
@@ -344,21 +402,6 @@ Analogie à SVN
|
|
|
|
|
|
---
|
|
---
|
|
|
|
|
|
-Your changes are now in the **HEAD** of your local working copy.
|
|
|
|
-
|
|
|
|
-**push**
|
|
|
|
->to send those changes to your remote repository
|
|
|
|
-```bash
|
|
|
|
-git push
|
|
|
|
-```
|
|
|
|
-**pull**
|
|
|
|
->to update your local working directory to the newest commit, to fetch and merge remote changes
|
|
|
|
-```bash
|
|
|
|
-git pull
|
|
|
|
-```
|
|
|
|
-
|
|
|
|
----
|
|
|
|
-
|
|
|
|

|
|

|
|
|
|
|
|
<!-- _footer: "**Limitation**" -->
|
|
<!-- _footer: "**Limitation**" -->
|
|
@@ -437,23 +480,4 @@ pull = fetch + merge
|
|
|
|
|
|
---
|
|
---
|
|
|
|
|
|
-# Simple Git Exercices
|
|
|
|
-
|
|
|
|
-First, configure your environment (just once) :construction:
|
|
|
|
-> on your laptop, on your ELIC account, etc
|
|
|
|
-
|
|
|
|
-```bash
|
|
|
|
-git config --global user.name "Your Name"
|
|
|
|
-git config --global user.email "foo@bar.be"
|
|
|
|
-git config --global color.ui auto
|
|
|
|
-git config --global core.editor "vim"
|
|
|
|
-
|
|
|
|
-git config --list
|
|
|
|
-```
|
|
|
|
-Now, clone https://gogs.elic.ucl.ac.be/TECLIM/Git_Training.git
|
|
|
|
-> Theses are very simple exercices to learn to manipulate git.
|
|
|
|
-> In each folder, simply run `./create.sh` and follow the guide :sunglasses:
|
|
|
|
-
|
|
|
|
----
|
|
|
|
-
|
|
|
|
# Version control with Git for scientists :chart_with_upwards_trend:
|
|
# Version control with Git for scientists :chart_with_upwards_trend:
|