| ... | @@ -2,7 +2,9 @@ Git is a "version control system". It is used by developers to keep track of the |
... | @@ -2,7 +2,9 @@ Git is a "version control system". It is used by developers to keep track of the |
|
|
|
|
|
|
|
Git is thus a **professional way to share code between developers**.
|
|
Git is thus a **professional way to share code between developers**.
|
|
|
|
|
|
|
|
## Install git (macOS)
|
|
# Install git
|
|
|
|
|
|
|
|
## 🍎 macOS
|
|
|
|
|
|
|
|
Open a terminal and type `git`. If git is not installed yet, the system will ask you if you want to install the developer tools.
|
|
Open a terminal and type `git`. If git is not installed yet, the system will ask you if you want to install the developer tools.
|
|
|
```
|
|
```
|
| ... | @@ -12,7 +14,7 @@ developer tools. |
... | @@ -12,7 +14,7 @@ developer tools. |
|
|
```
|
|
```
|
|
|
Agree and proceed with the installation.
|
|
Agree and proceed with the installation.
|
|
|
|
|
|
|
|
## Install git (Linux)
|
|
## 🐧 Linux
|
|
|
|
|
|
|
|
On the [CECI clusters](http://www.ceci-hpc.be/), a recent version of git is available as soon as your are connected to the master node.
|
|
On the [CECI clusters](http://www.ceci-hpc.be/), a recent version of git is available as soon as your are connected to the master node.
|
|
|
|
|
|
| ... | @@ -36,19 +38,17 @@ sudo apt install nano |
... | @@ -36,19 +38,17 @@ sudo apt install nano |
|
|
|
|
|
|
|
If you work on **Windows**, git is not provided by Microsoft with the OS. You must install it before the next steps (see next section).
|
|
If you work on **Windows**, git is not provided by Microsoft with the OS. You must install it before the next steps (see next section).
|
|
|
|
|
|
|
|
## Download git (Windows only)
|
|
## 🪟 Windows
|
|
|
|
|
|
|
|
Download the latest version of git from the website: https://git-scm.com/
|
|
Download the latest version of git from the website: https://git-scm.com/
|
|
|
|
|
|
|
|
## Install git (Windows only)
|
|
|
|
|
|
|
|
|
|
Double-click on the installer, then follow the instructions. Choose the default options except for the default editor which is configured for "vim" (an old type of editor which is rather difficult to use).
|
|
Double-click on the installer, then follow the instructions. Choose the default options except for the default editor which is configured for "vim" (an old type of editor which is rather difficult to use).
|
|
|
|
|
|
|
|

|
|

|
|
|
|
|
|
|
|
Choose one editor that you know well instead of vim (e.g. NotePad or [NotePad++](https://notepad-plus-plus.org/) on Windows).
|
|
Choose one editor that you know well instead of vim (e.g. NotePad or [NotePad++](https://notepad-plus-plus.org/) on Windows).
|
|
|
|
|
|
|
|
## Configure git (Windows/Linux/macOS)
|
|
# ⚙️ Configure git
|
|
|
|
|
|
|
|
On Windows, you can use "git" by right-clicking on a folder in the windows explorer and by running "Git Bash Here". Git is also available in any command-line window (Run "cmd", then type `git` in the terminal).
|
|
On Windows, you can use "git" by right-clicking on a folder in the windows explorer and by running "Git Bash Here". Git is also available in any command-line window (Run "cmd", then type `git` in the terminal).
|
|
|
|
|
|
| ... | @@ -65,7 +65,7 @@ Git must know your name and e-mail address. All your personal work will be ident |
... | @@ -65,7 +65,7 @@ Git must know your name and e-mail address. All your personal work will be ident |
|
|
|
|
|
|
|
This configuration step should be done once per computer, the first time you use git.
|
|
This configuration step should be done once per computer, the first time you use git.
|
|
|
|
|
|
|
|
## Configure SSH keys
|
|
# 🔑 Configure SSH keys
|
|
|
|
|
|
|
|
The GitLab of ULiège does not allow you to use your student-ID / password for git commands. It uses a pair of "SSH keys" (one "private key" that should never be shared with anyone and a "public key" which can be given to anyone who wants to check that you own the "private key").
|
|
The GitLab of ULiège does not allow you to use your student-ID / password for git commands. It uses a pair of "SSH keys" (one "private key" that should never be shared with anyone and a "public key" which can be given to anyone who wants to check that you own the "private key").
|
|
|
|
|
|
| ... | @@ -139,7 +139,7 @@ Welcome to GitLab, @Your_name! |
... | @@ -139,7 +139,7 @@ Welcome to GitLab, @Your_name! |
|
|
|
|
|
|
|
If you do not get the welcome message "Welcome to GitLab\`, something went wrong in the previous steps. Read again the instructions.
|
|
If you do not get the welcome message "Welcome to GitLab\`, something went wrong in the previous steps. Read again the instructions.
|
|
|
|
|
|
|
|
# Clone the repository
|
|
# ⏬ Clone the repository
|
|
|
|
|
|
|
|
You should now be able to retrieve the code from this repository with the following command:
|
|
You should now be able to retrieve the code from this repository with the following command:
|
|
|
|
|
|
| ... | @@ -147,25 +147,9 @@ You should now be able to retrieve the code from this repository with the follow |
... | @@ -147,25 +147,9 @@ You should now be able to retrieve the code from this repository with the follow |
|
|
git clone git@gitlab.uliege.be:rboman/math0471.git
|
|
git clone git@gitlab.uliege.be:rboman/math0471.git
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
# Learn git
|
|
# 📝 Learn git
|
|
|
|
|
|
|
|
There are numerous tutorials on git on the web:
|
|
|
|
|
|
|
|
|
|
- [GitLab tutorials](https://docs.gitlab.com/ee/tutorials/learn_git.html)
|
|
|
|
|
- [Official git documentation](https://git-scm.com/doc)
|
|
|
|
|
- [Atlassian tutorial](https://www.atlassian.com/fr/git/tutorials)
|
|
|
|
|
- ...
|
|
|
|
|
|
|
|
|
|
There are also several e-books, which can be legally downloaded from [ULiège's library](https://lib.uliege.be) (use VPN - [search for "git"](https://explore.lib.uliege.be/discovery/search?query=any,contains,git&tab=ULIEGE&search_scope=ULIEGE&vid=32ULG_INST:ULIEGE&offset=0)) or the internet (e.g. [Pro Git](https://git-scm.com/book/fr/v2)).
|
|
|
|
|
|
|
|
|
|
You may also have a look at this presentation [Git at ULiège by R.Boman (in French)](http://metafor.ltas.ulg.ac.be/dokuwiki/\_media/devel/git_latest.pdf).
|
|
|
|
|
|
|
|
|
|
If you prefer youtube videos, here are some links about git and GitLab:
|
|
|
|
|
|
|
|
|
|
* [Git for GitLab (Beginner's FULL COURSE)](https://www.youtube.com/watch?v=4lxvVj7wlZw&ab_channel=ValentinDespa)
|
|
|
|
|
* [Learn GitLab in 3 Hours | GitLab Complete Tutorial For Beginners](https://www.youtube.com/watch?v=8aV5AxJrHDg&ab_channel=LambdaTest)
|
|
|
|
|
|
|
|
|
|
# Basic git workflow
|
|
## 🌿 Basic git workflow
|
|
|
|
|
|
|
|
Create a repository:
|
|
Create a repository:
|
|
|
|
|
|
| ... | @@ -273,7 +257,26 @@ Tag your project for a deadline (a "tag" is a string which identifies a particul |
... | @@ -273,7 +257,26 @@ Tag your project for a deadline (a "tag" is a string which identifies a particul |
|
|
|
|
|
|
|
* Do this on GitLab.
|
|
* Do this on GitLab.
|
|
|
|
|
|
|
|
# Hints
|
|
## 🌐 Learn from the web...
|
|
|
|
|
|
|
|
There are numerous tutorials on git on the web:
|
|
|
|
|
|
|
|
- [GitLab tutorials](https://docs.gitlab.com/ee/tutorials/learn_git.html)
|
|
|
|
- [Official git documentation](https://git-scm.com/doc)
|
|
|
|
- [Atlassian tutorial](https://www.atlassian.com/fr/git/tutorials)
|
|
|
|
- ...
|
|
|
|
|
|
|
|
There are also several e-books, which can be legally downloaded from [ULiège's library](https://lib.uliege.be) (use VPN - [search for "git"](https://explore.lib.uliege.be/discovery/search?query=any,contains,git&tab=ULIEGE&search_scope=ULIEGE&vid=32ULG_INST:ULIEGE&offset=0)) or the internet (e.g. [Pro Git](https://git-scm.com/book/fr/v2)).
|
|
|
|
|
|
|
|
You may also have a look at this extensive presentation [Git at ULiège by R.Boman (in French)](http://metafor.ltas.ulg.ac.be/dokuwiki/\_media/devel/git_latest.pdf).
|
|
|
|
|
|
|
|
If you prefer youtube videos, here are some links about git and GitLab:
|
|
|
|
|
|
|
|
* [Git for GitLab (Beginner's FULL COURSE)](https://www.youtube.com/watch?v=4lxvVj7wlZw&ab_channel=ValentinDespa)
|
|
|
|
* [Learn GitLab in 3 Hours | GitLab Complete Tutorial For Beginners](https://www.youtube.com/watch?v=8aV5AxJrHDg&ab_channel=LambdaTest)
|
|
|
|
|
|
|
|
|
|
|
|
# 💡 Hints
|
|
|
|
|
|
|
|
* Do not push unnecessary files! Add a `.gitignore` to your project. Always check that you do not send the numerical results of your code or the program binaries (executables) to GitLab. This is very important because it is not easy to remove files from the history stored on GitLab.
|
|
* Do not push unnecessary files! Add a `.gitignore` to your project. Always check that you do not send the numerical results of your code or the program binaries (executables) to GitLab. This is very important because it is not easy to remove files from the history stored on GitLab.
|
|
|
* Keep the `main` branch stable (it should always produce no errors during the build and all the tests should run successfully!).
|
|
* Keep the `main` branch stable (it should always produce no errors during the build and all the tests should run successfully!).
|
| ... | |
... | |
| ... | | ... | |