...
 
Commits (20)
image: digitallyseamless/nodejs-bower-grunt
image: git-r3lab.uni.lu:4567/r3/docker/nodejs-yarn-grunt
pages:
stage: deploy
......
# Aims of the Tutorial
* Connect to a GNU/Linux server
+ SSH, a de-facto standard for secure communication
<!-- .element: class="fragment" -->
+ For Windows users
- [MobaXterm][1] (_recommended by R3_)
- [PuTTY][2], simple, ugly, but efficient and open source and does only SSH
<!-- .element: class="fragment" -->
+ For Mac and GNU/Linux users, OpenSSH command line client
<!-- .element: class="fragment" -->
<!-- .element: class="fragment" -->
* Explore how to use the shell effectively
* We will use bash which is (almost) universaly present
- Steve Jobs did not like the license, but ...
```shell
brew install bash
```
<!-- .element: class="fragment" -->
<!-- .element: class="fragment" -->
<!-- .element: class="fragment" -->
[1]: https://mobaxterm.mobatek.net/download-home-edition.html
[2]: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
# Presentation Title
# Introduction to GNU/Linux (Shell)
## Month XYth, 2019
## 26 March 2020
<div style="top: 6em; left: 0%; position: absolute;">
<img src="theme/img/lcsb_bg.png">
......
# Aims of the Tutorial
* Gain Familiarity With the Unix Shell
- And hint at ways it can be harnessed to give great power to the
user
<!-- .element: class="fragment" -->
* Connect to a GNU/Linux server
+ Using SSH, a de-facto standard for secure communication
<!-- .element: class="fragment" -->
<!-- <iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/A-HIlNGczgU" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> -->
# Before We Begin ...
# Or, the Beginning of One?
* Learning GNU/Linux has never been easier!
+ An explosion of [resources for self-study][1]
......@@ -18,7 +18,7 @@
<!-- .element: class="fragment" -->
[1]: https://git-r3lab.uni.lu/R3/school/courses/blob/gnu-linux/2020/2020-02-15_gnuLinuxCourse/resources.md
[1]: https://git-r3lab.uni.lu/R3/school/courses/blob/develop/2020/2020-02-15_gnuLinuxCourse/resources.md
[2]: https://duckduckgo.com
[3]: https://unix.stackexchange.com/
[4]: https://www.reddit.com/r/linux/
......@@ -11,7 +11,8 @@
<!-- .element: class="fragment" -->
+ GNU/Linux user since [Debian Woody][5] (ca 2002)
+ Arrived as a seven CD set from a small computer shop from the [Getting Debian][6]
+ Arrived as a seven CD set from a small computer shop from the
list of international vendors at [Getting Debian][6]
<!-- .element: class="fragment" -->
......
# The End
* Thanks for your attention!
[
{ "filename" : "index.md" },
{ "filename" : "intro_first.md"},
{ "filename" : "the-end.md"},
{ "filename" : "intro_beforewebegin.md"},
{ "filename" : "intro_aim.md"},
{ "filename" : "shell.md"},
{ "filename" : "shell/start.md"},
{ "filename" : "shell/file-explorer-basic.md"},
{ "filename" : "shell/file-explorer-basic-concepts.md"},
{ "filename" : "shell/effective-cmd-editing.md"},
{ "filename" : "shell/effective-cmd-editing-concepts.md"},
{ "filename" : "shell/cp-mv.md"},
{ "filename" : "shell/rm.md"},
{ "filename" : "shell/cp-mv-rm-concepts.md"},
{ "filename" : "ssh_intro.md"},
{ "filename" : "ssh_intro_2.md"},
{ "filename" : "ssh_intro_3.md"},
......@@ -16,5 +26,6 @@
{ "filename" : "ex_ssh_win/ssh_keygen.md"},
{ "filename" : "ex_ssh_lin/intro.md"},
{ "filename" : "ex_ssh_lin/session_shell.md"},
{ "filename" : "ex_ssh_lin/session_shell_2.md"}
{ "filename" : "ex_ssh_lin/session_shell_2.md"},
{ "filename" : "last.md"}
]
# The Barrier between the Human and the Machine
<div class="multicol">
<div class="col" data-markdown>
* What is a shell?
- Omnipresent user interface
<!-- .element: class="fragment" -->
- It interprets commands given by the user
<!-- .element: class="fragment" -->
- It is heavily keyboard based
<!-- .element: class="fragment" -->
<!-- .element: class="fragment" -->
* Shell runs within a terminal application
- In ancient times, these were actual pieces of hardware
<!-- .element: class="fragment" -->
- Today, a program that echoes user input and displays command results
<!-- .element: class="fragment" -->
<!-- .element: class="fragment" -->
* How to access it?
- **GNU/Linux systems:**
- Depends on the desktop interface (of which there are many)
- Access from a `Start`-like menu, or a `Win`-key search as
*terminal*, or *console*
- if all else fails, `Ctrl` + `Alt` + `F[2-6]`
<!-- .element: class="fragment" -->
- **Windows:** [MobaXterm][1] which you hopefully installed
<!-- .element: class="fragment" -->
- **Mac:** Built-in terminal; *Spotlight* search for *terminal*
<!-- .element: class="fragment" -->
<!-- .element: class="fragment" -->
</div>
<div class="col" data-markdown>
<img src="variae/figs/shell/3270.jpg" width="90%" />
<!-- .element: class="fragment" -->
</div>
</div>
[terminal]: variae/figs/shell/3270.jpg "IBM 3270"
[1]: https://mobaxterm.mobatek.net/download-home-edition.html
# File Explorer: Copy(cp), Move(mv) and Remove(rm) (Concepts)
* cp, mv and rm can act on either files, or directories
```shell
cp file1 file2
mv file1 file2
cp -R dir1 new/location
mv dir1 new/location
cp file1 file2 ... some/existing/dir
mv file1 file2 ... some/existing/dir
rm file1 ...
rm -R dir
rm -Rf dir # Danger!
```
* Effectiveness of these commands greatly improved by file patterns
- *, ., [0-9],[ABC], {}, etc
# File Explorer: Copy(cp), Move(mv) and Remove(rm) File Operations
```console
$ mkdir linux-practical-03
$ cp linux-practical-01/pr1-hello-world.txt linux-practical-03/pr3-hello-world.txt # cp arg1 arg2: copy file arg1 to file arg2
$ mkdir linux-practical-03/dump
$ cp -R linux-practical-01 linux-practical-03/dump # Copy the entire content of linux-practical-01
$ # to dump subdirectory of linux-practical-03
$ ls linux-practical-03/dump # Check if linux-practical-01 is there.
$ # Move one up in history, jump to the beginning of the line ('Ctrl'+'A'), then
$ # replace 'ls' with 'mv'
$ # From then on ...
$ mv linux-practical-03/dump linux-practical-03/dump2 # Congratulations, you just renamed dump to dump2.
$ ls linux-practical-03 # Check the content. The directory dump should not exist.
```
# File Explorer: Effective Command Line Editing (Concepts)
* Moving using arrow keys is tedious
* Retyping commands that contain a typo is even more tedious
* *Readline* facility of the bash shell offers quicker navigation
- Move by a word left and right using `Ctrl`+`Left`, or `Right`
- Move to a beginning, or the end of the line using `Ctrl`+`A` and `Ctrl`+`E`
- Delete an entire word using `Alt`+`D`
- Paste a deleted word with `Ctrl`+`Y`
* Reuse previous commands!
- The shell remembers what you type
- Move to a previous line in history using `Up` and `Down` arrows
# File Explorer: Effective Command Line Editing
```console
$ # Move up the history list until 'mkdir linux-practical-01'.
$ # Move cursor using word motions 'Ctrl' + 'Left', or
$ # 'Ctrl' + 'Right' around the command to get the feel for word motions.
$ # Move cursor using begin ('Ctrl' + 'A') and end ('Ctrl' + 'E')
$ # motions to the beginning and the end of the line.
$ mkdir linux-practical-02 # Based on the previous command + motions.
$ cd lin # TAB to complete, then TAB two times to list possible endings.
$ cd linux-practical-02 # Based on the previous completion.
$ # Move up the history list to mkdir subdir-01
$ mkdir subdir-02
$ # Move up the history to the touch subdir-01/a ... command.
$ # Replace 1 with 2 using 'Ctrl' + 'A' and word motions.
$ touch subdir-02/a subdir-02/b subdir-02/c
$ history 10 # Lists last ten commands.
$ cd
```
<!-- * Motions -->
<!-- - `Left` and `Right` arrow move one character left, or right -->
<!-- - `Ctrl` + `Left`, or `Right` move left, or right for one word -->
<!-- - `Ctrl` + `A`, or `E` move to the beginning, or the end of the line -->
<!-- - `Up` and `Down` move through history entries -->
<!-- - `TAB` completes -->
# File Explorer: Basics (Concepts)
* While interacting with a shell, we are always in a given *working directory*
* Data is organised into directories and files, like on other systems.
* Location of a file in respect to the current directory is given by a (*relative*) file path
- some/dir/with/a/file
* New commands:
- `pwd` : outputs the current working directory
- `ls [-lhd ... file1 file2 file3 ...]` : lists files
- `cd path/to/existing/dir` : change current directory to a new directory
- `mkdir [-p] path/to/new/dir` : creates a new directory
- `touch file1 [file2 file3 ...]` : creates an empty file.
- `history` : view the list of commands executed so far
# File Explorer: Basics
```console
$ pwd # Displays the absolute path to the current dirrectory.
$ ls # List contents of the current directory.
$ mkdir linux-practical-01 # Create a new directory.
$ cd linux-practical-01 # Switch to a different directory.
$ touch pr1-hello-world.txt # Create a new and empty file.
$ mkdir subdir-01 # Create another directory.
$ touch subdir-01/a subdir-01/b subdir-01/c # Create multiple empty files.
$ ls subdir-01 # List contents of directory.
$ mkdir -p subdir-02/dir-X/dir-Y/dir-Z # Create a nested directory under the path.
$ ls subdir-02/dir-X # Confirm the directory dir-Y has been created.
$ history # Lists the commands executed so far.
$ cd
```
<!-- * Concepts -->
<!-- - Files and directories -->
<!-- - Paths -->
<!-- - Importance of quoting -->
<!-- - History -->
# File Explorer: Copy(cp), Move(mv) and Remove(rm) File Operations
* Removing files and directories.
```console
$ rm linux-practical-03/pr3-hello-world.txt # Deletes the file.
$ # History, one up then adapt the command into
$ cd linux-practical-03
$ ls # Check if it is indeed deleted.
$ rm -R dump2 # Recursively remove directory dump2 and all of its contents.
$ history 10 # Just to remind yourself what you did in last ten steps.
$ cd
```
# Command Line
* **Command prompt:** Non-editable; May provide contextual information
* **Command area:** Typed commands are shown here
* **RETURN or ENTER:** Pressing this key will execute the command
* General form of the commands
```shell
prompt$ ls
prompt$ ls -a
prompt$ ls --help
prompt$ rsync -avz /path/to/file/a /path/to/file/b
prompt$ make -j8
prompt$ gfortran -c -mtune=native
```
# The End of an Era?
<iframe width="100%" height="800" src="https://www.youtube.com/embed/A-HIlNGczgU?start=127" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
# Best practices
* `pull` before `push`
* Work on your <font color="red">own</font> branch (in your own fork), and **not** on `master` and **not** on `develop`
* Do **not push** to `master`, but **submit a Merge Request (MR)**
* Get your code **reviewed** by your peers (submit a MR!)
* Submit a MR **often**!
* `clone` a repository, do not download the `.zip` file.
* Do **not** combine `git` commands
```bash
$ git commit -am "myMessage" # do not do this
```
* Stage only 1 file at once using
```bash
$ git add myFile.md
```
* Commit **only a few files** at once (after multiple separate `git add` commands)
* `Push` often - avoid conflicts
Remember: **A `push` a day keeps conflicts away!**
# Development scheme
Generally, in a repository, there are guidelines for contributing.
<div class="fragment">
A common development scheme is dual with a:
- **development** version of the code on `develop`
- **stable** version of the code on `master`
A **version** of the code is referred to as a **branch**.
<div class="fragment">
<img src="slides/img/icon-live-demo.png" height="100px">
<font color="red">In the practice repository, the development branch is called `develop`!</font>
<div class="fragment">
![bulb](slides/img/bulb.png) Use this dual development scheme for your own repositories!
# Branches
A **version** of the code (i.e., a **branch**) is made up of a sequence of code changes.
<div class="fragment">
These individual code changes are called **commits**.
For instance, the `master` and `develop` branches can be represented as a timeline:
<img src="slides/img/branch-master.png" class="branch-master" height="500em"/>
# Switch between branches
List all branches of the repository with
```bash
$ git branch -a
```
Exit by typing `q`. The branch with the * is the current branch.
<div class="fragment">
Checkout another branch
```bash
$ git checkout <branchName>
```
<div class="fragment">
You can switch to the `develop` branch with
```bash
$ git checkout develop
```
If the local branch does not exist but the remote does, it is created automatically.
<div class="fragment">
<img src="slides/img/icon-live-demo.png" height="100px">
# Create your own version
Assume that you want to work on a file:
<div class="fragment">
<font color="red">Create a new **branch**!</font>
```bash
$ git checkout -b myBranch
```
The `-b` flag creates the branch. Locally, you have your own version now:
<img src="slides/img/branch-create.png" class="branch-create" height="500em"/>
Push your version to your fork:
```bash
$ git push origin myBranch
```
<div class="fragment">
<img src="slides/img/icon-live-demo.png" height="100px">
# How do I start working on a repository?
You have to `clone` it first:
```bash
$ git clone ssh://git@git-r3lab-server.uni.lu:8022/<groupName>/myRepo.git myRepo
```
If you did not configure your SSH key, clone using HTTPS:
```bash
$ git clone https://git-r3lab.uni.lu/<groupName>/myRepo.git myRepo
```
You will be prompted to enter your credentials.
# How to configure `git`?
```bash
$ git config --global user.name "Firstname Lastname"
$ git config --global user.email "first.last@uni.lu"
```
Test whether your username and email have been registered
```bash
$ git config --list
```
This should list the configuration with `user.name` and `user.email`.
Exit by typing `q`.
# What is an SSH key?
An SSH key is a secure access credential.
**Principle**: <br><br>
Communicate **securely** with Github/Gitlab **without** entering the username/password.
# How do I get and set my SSH key?
Check if you already have an SSH key:
```bash
$ ls -al ~/.ssh
```
If there are 2 files named `id_rsa`, you have an SSH key.
If you don’t have yet an SSH key, you have to generate one:
```bash
$ ssh-keygen -t rsa # -b 4096
```
If you set a password to your key (recommended), add it to the `ssh-agent`:
```bash
$ eval "$(ssh-agent -s)"
$ ssh-add -K ~/.ssh/id_rsa
```
Then, add the SSH key to Github/Gitlab.
<img src="slides/img/icon-live-demo.png" height="100px">
\ No newline at end of file
# The 5 essential commands
**Yes**, you only need 5 commands!
`pull, status, add, commit, push`
or in other words (remember these!):
```bash
$ git pull <remote> <branch>
$ git status
$ git add myFile.md # example
$ git commit -m "myMessage" # example
$ git push <remote> <branch>
```
# Pull the latest version of an existing branch
Pull the latest revision on branch `myBranch`:
```bash
$ git pull origin myBranch
# Already up to date
```
<div class="fragment">
Verify its `status` with:
```bash
$ git status
```
# Modify a file
Copy the file `template.md` in the folder `attendees` and rename it with your firstname:
```bash
$ cd attendees
$ cp firstnameLastname.md myName.md
```
Then, make your changes with your favorite editor!
# Add your file to the stage
First, check the repository status
```bash
$ git status
# uncommitted changes (displayed in red)
```
<div class="fragment">
Now, add the file (bring it on stage)
```bash
$ git add myName.md # replace myName
$ git status
# returns the same as before, generally in green (means staged)
```
<div class="fragment">
**ADVANCED**: If there have been more changes after the file has been added, you can see your changes in the terminal
```bash
$ git diff
```
exit with `q`
# Add a commit message
```bash
$ git commit -m "Add the profile of <myName>"
$ git status
```
# Push your file to your fork
```bash
$ git push origin myBranch
```
<div class="fragment">
**ADVANCED**: see the log of all the commits (and your last one) in the terminal
```bash
$ git log
```
exit by typing `q`.
\ No newline at end of file
# What is a `fork`?
<center>
<img src="slides/img/fork.jpg" class="as-is" height="500em"/>
</center>
<!--http://www.cndajin.com/data/wls/246/22302193.jpg-->
# Not really ...
<center>
<img src="slides/img/fork-crossed.png" class="as-is" height="500em"/>
</center>
# What is a `fork`?
- In general, when contributing to a repository, you only have **read** access.
- In other words, you can only **pull** (unless it is your own repository or access has been granted).
- In general, you **cannot write** changes. In other words, you do not have **push** access.
- You have to work on your **own copy**.
- In other words, you have to work on your own <font color="red">**fork**</font>.
# How to get a fork?
Browse to the original repository and click on the button `Fork`:
![Fork the repo](https://help.github.com/assets/images/help/repository/fork_button.jpg)
<img src="slides/img/icon-live-demo.png" height="100px">
# Time to practice!
Fork the practice repository: <br><br>
https://git-r3lab.uni.lu/R3/school/git/basic-practice-pages<br><br>
Then, clone your fork to your home directory!
<img src="slides/img/icon-live-demo.png" height="100px">
```bash
$ git clone ssh://git@git-r3lab-server.uni.lu:8022/<yourName>/basic-practice-pages.git
```
Change to the practice directory with:
```bash
$ cd basic-practice-pages
```
# A note on shortcuts ...
<font color="red">
Any other rudimentary method such as
*'I simply download the `.zip` and unzip it - works like a charm!'*
shall **be avoided**!
</font>
**Why?**
# How to update my fork?
As you have your own fork, it will not automatically be updated once the original repository is updated.
![bulb](slides/img/bulb.png) You have to update it yourself!
<br>
**More on that later!**
# GitHub and GitLab
<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" alt="GitHub" style="width: 200px;"/>
<img src="https://gitlab.com/gitlab-com/gitlab-artwork/raw/master/logo/logo-extra-whitespace.png" alt="GitLab" style="width: 200px;"/>
GitHub and GitLab are VCS systems.
GitHub/Gitlab are both **publicly available**, but GitLab can be **on-premise**.
Positive point: GitHub and GitLab are (almost) the same.
<img src="slides/img/icon-live-demo.png" height="100px">
- **GitHub**: [https://github.com](https://github.com)
- Public GitLab: [https://gitlab.com](https://gitlab.com)
- LCSB specific: [https://git-r3lab.uni.lu](https://git-r3lab.uni.lu)
\ No newline at end of file
../../../2019/2019-06-11_basicGitTraining/slides/img
\ No newline at end of file
# R3.school
## March 30th, 2020
<div style="top: 6em; left: 0%; position: absolute;">
<img src="theme/img/lcsb_bg.png">
</div>
<div style="top: 5em; left: 60%; position: absolute;">
<img src="slides/img/r3-training-logo.png" height="200px">
<br><br><br>
<h1>git training for beginners</h1>
<br><br><br><br>
<h4>
Laurent Heirendt, Ph.D.<br><br>
laurent.heirendt@uni.lu<br><br>
<i>Luxembourg Centre for Systems Biomedicine</i>
</h4>
</div>
# The terminal (shell)
**macOS users:**
> Start the Terminal from your `/Applications` directoy.
![bulb](slides/img/bulb.png) Install iTerm2: [https://www.iterm2.com](https://www.iterm2.com)
<br>
**Windows users:**
> Install Git Bash: [https://git-scm.com/download/win](https://git-scm.com/download/win)
<br>
**Linux users:**
> Launch default terminal.<br>
![bulb](slides/img/bulb.png) Install Terminator: [https://launchpad.net/terminator](https://launchpad.net/terminator)
# Installation of `git`
<img src="slides/img/github_app.png" class="as-is" height="200" />
**macOS**
> Install *Xcode Command Line Tools*
<br>
**Windows**
> Install Git Bash: <br>`https://git-scm.com/download/win`
<br>
**Linux (Ubuntu)**
```bash
$ sudo apt-get install git-all
```
# How to get started?
**macOS**
> Start the `Terminal` or `iTerm`.
<br>
**Windows**
> Start `GUI Bash`.
<br>
**Linux (Ubuntu)**
> Start the `Terminal` or `Terminator`.
[
{ "filename": "index.md" },
{ "filename": "overview.md" },
{ "filename": "what_is_git.md" },
{ "filename": "github_gitlab.md" },
{ "filename": "installation.md" },
{ "filename": "the_terminal.md" },
{ "filename": "the_editor.md" },
{ "filename": "configuration.md" },
{ "filename": "cloneRepo.md" },
{ "filename": "forks.md" },
{ "filename": "branches.md" },
{ "filename": "essential_commands.md" },
{ "filename": "merge.md" },
{ "filename": "syncFork.md" },
{ "filename": "best_practices.md" },
{ "filename": "thanks.md" }
]
# Merge (pull) requests
If you want your changes to be reflected on the `develop` or `master` branches,
**submit a merge request (MR)** via the git-r3lab interface.
Use the **interface** to make use of your peers to review your code!
<img src="slides/img/branch-merge.png" class="branch-merge" height="500em"/>
Once merged, you can delete the branch via the interface.
<div class="fragment">
<img src="slides/img/icon-live-demo.png" height="100px" >
\ No newline at end of file
# Overview
1. What is `git`? What is the use of `git`?
2. GitHub and GitLab
3. The terminal
4. Installation of `git`
5. The editor
6. How do I configure `git`?
7. Where and how to start?
8. What is a fork?
9. What are branches?
10. The 5 essential commands (`pull` / `status` / `add` / `commit` / `push`)
11. What are merge/pull requests?
12. How do I synchronize my fork?
13. Best practices
\ No newline at end of file
# Synchronize your fork
![bulb](slides/img/bulb.png) Remember, we have to regularly update our own copy of the code.
Add the `upstream` address (original/protected repository)
```bash
$ URL=ssh://git@git-r3lab-server.uni.lu:8022/R3/school/git/basic-practice-pages.git
$ git remote add upstream $URL
```
![bulb](slides/img/bulb.png) Note the change in the URL.
You can then check whether the remote address is set correctly
```bash
$ git remote -v
```
<div class="fragment">
Fetch the changes from upstream (similar to pull)
```bash
$ git fetch upstream
```
Merge the retrieved changes on the `master` branch:
```bash
$ git checkout master
$ git merge upstream/master
$ git push origin master
```
<div class="fragment">
Do the same for the `develop` branch:
```bash
$ git checkout develop
$ git merge upstream/develop
$ git push origin develop
```
<img src="slides/img/icon-live-demo.png" height="100px">
\ No newline at end of file
# Let's refresh our memories
<div class="fragment">
- What is a **fork**?
<div class="fragment">
- What are **branches**?
<div class="fragment">
- Can I have **multiple branches** in my fork?
<div class="fragment">
- What is a good **development scheme**?
<div class="fragment">
- What are the **5 essential commands**?
# References & Cheat sheet
1. Git Book: https://git-scm.com/book/en/v2
2. Cheat sheet: http://rogerdudler.github.io/git-guide
# Thank you.
<img src="slides/img/r3-training-logo.png" height="200px">
Contact us if you need help:
lcsb-r3@uni.lu
# The editor(s)
Recommended editors:
- **Visual Studio Code** [https://code.visualstudio.com](https://code.visualstudio.com)
- **Atom** [https://atom.io](https://atom.io)
*Note*: Other editors such as can, of course, also be used. Examples:
- IntelliJ IDEA [https://www.jetbrains.com/idea](https://www.jetbrains.com/idea)
- Sublime Text [https://www.sublimetext.com](https://www.sublimetext.com)
<img src="slides/img/icon-live-demo.png" height="100px">
\ No newline at end of file
# First steps in the terminal
Starting the terminal presents itself with a line where you can enter a command
```bash
cesar@myComputer>
```
Often written, for covenience, as
```bash
$
```
When you open your terminal (shell), you are located
in your home directory (unless otherwise configured), denoted as `~/`.
<br>
**Is `git` properly installed?**
```bash
$ git --version
# git version 2.10.0
```
# Essential Linux commands
List the contents of a directory
```bash
$ ls #-lash
```
Create a directory
```bash
$ mkdir myNewDirectory
```
Change the directory to a specific folder
```bash
$ cd myNewDirectory
```
Change the directory 1 level and 2 levels up
```bash
$ cd ..
# 1 level up
$ cd ../..
# 2 levels up
```
Move a file or a directory
```bash
$ mv myFile.m myNewDirectory/.
```
Rename a file or a directory
```bash
$ mv myFile.m myNewFile.m
$ mv myNewDirectory myDirectory
```
\ No newline at end of file
# What is `git`?
<!-- ![](slides/img/git_definition.png) -->
`git` is a **version control system** (VCS) for tracking changes in computer files and coordinating work on those files among multiple people [1].
Designed and implemented in 2005 by **Linus Torvalds**
<div align="center">
<img src="slides/img/linus.jpg">
</div>
[1] *https://en.wikipedia.org/wiki/Git*
# The inventor of `git`
<div align="center">
<img src="slides/img/git_definition.png">
</div>
`I'm an egotistical bastard, and I name all my projects after myself.
First Linux, now git.`
Linus Torvald (2007-06-14)
# What is the use of `git`?
* No need to fully rewrite code; **reuse code** and **save time**
* Keep the changes you made over time (**history**)
* Allows you to **backtrack** (if necessary) and undo unwanted changes
* Easily **add contributions** of your collaborators to the main code base
note:
Other points to mention:
* git shall not be considered as a nuisance, but as a tool that should help to track and trace the code.
* git is not to track performance. Not using it shows exactly the opposite.