Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Tutorial Forgemia
This tutorial is structured as a series of _missions_ or _challenges_. Each one should be easy to accomplish. You will progressively unlock the skills needed to use `git` at a basic level for collaborating on Forgemia.
I will provide links to necessary materials and to further information.
__Mission 1__ Install `git` on your computer
`git` is a program for managing versions of code (or text).
Install it and set it up.
https://happygitwithr.com/install-git.html
https://happygitwithr.com/hello-git.html
__Mission 2__ Install a `git` _client_ (optional)
This is a program that interfaces `git` and provides a graphpical user interface, similar to RStudio interfacing `R`.
There are plenty of options both commercial and free, depending on the operating system.
I will use barebones `git` in the tutorial to cover the basics. But you are welcome to try some client.
https://happygitwithr.com/git-client.html
__Mission 3__ Set up a working directory for the tutorial
- Create a new directory called `Forgemia_test`.
- Create a plain text file named `script.R` with a few lines of code within a subdirectory `src`.
- Create a plain text file named `Readme.md` and write a title and some description of this test project.
- Create a Word document named `binary.docx` and write a few words.
__Mission 4__ Set up a `git` local repository in your working directory
Open a terminal and change to your working directory.
Run `git init` in order to set up a `git` local repository and start tracking versions.
Running `git status` will inform you that your files are untracked.
__Mission 5__ Commit the first version of your work
You have to explicitly tell `git` which files you want to track.
For the moment, we will track everything: `git add *`
We will create the first _version_ (think of a snapshot of your work at this time) with `git commit -m "Initial commit"`.
What commes after `-m` is a label known as _commit message_ that informs about the purpose of the changes.