| ... | ... | @@ -75,7 +75,7 @@ On GitLab, go to the [Edit Profile](https://gitlab.uliege.be/-/profile) of your |
|
|
|
|
|
|
|
Then choose "SSH keys" on the menu on the left.
|
|
|
|
|
|
|
|
Follow the [procedure](https://gitlab.uliege.be/help/user/ssh.md#generate-an-ssh-key-pair) to create a SSH-key pair (in a "git-bash" terminal on Windows, or a terminal on the other platforms).
|
|
|
|
Follow the following procedure to create a SSH-key pair (in a "git-bash" terminal on Windows, or a terminal on the other platforms):
|
|
|
|
|
|
|
|
Use the "RSA" type, which is more compatible with older machines.
|
|
|
|
|
| ... | ... | @@ -91,9 +91,11 @@ The key fingerprint is: |
|
|
|
SHA256:8ijxJLH1SETJZVkbRbBUXXdlmXE17C3mspK/KrSC/Jc demo
|
|
|
|
```
|
|
|
|
|
|
|
|
You can use an empty passphrase if you do not share your private key (if it stays on your laptop, or if you trust the system administrator).
|
|
|
|
You can use an **empty passphrase** if you do not share your private key (if it stays on your laptop, or if you trust the system administrator). This is very convenient because you will never have to type a password. But be sure that noone has access to your files on your computer if you chosse to do so.
|
|
|
|
|
|
|
|
The previous command created 2 files located in `c:\\Users\\your_name\\.ssh\\` (Windows) or `\~/.ssh/` (anywhere else): a public key `id_rsa.pub` and a private key `id_rsa`. The private key is similar to a password. Anyone who owns this file is able to behave as you on GitLab! It should never be shared if it is not protected by a password!
|
|
|
|
⚠️ **Do not change the path** where the keys are written to. Otherwise you will have to specify them as an argument of each git command you type!
|
|
|
|
|
|
|
|
The `ssh-keygen` command created 2 files located in `c:\\Users\\your_name\\.ssh\\` (Windows) or `\~/.ssh/` (anywhere else): a public key `id_rsa.pub` and a private key `id_rsa`. The private key is similar to a password. Anyone who owns this file is able to behave as you on GitLab! It should never be shared if it is not protected by a password!
|
|
|
|
|
|
|
|
Open the public key (file `.ssh/id_rsa.pub`) in an editor...
|
|
|
|
|
| ... | ... | @@ -139,9 +141,12 @@ 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.
|
|
|
|
|
|
|
|
The official procedure from the GitLab documentation can be found [here](https://gitlab.uliege.be/help/user/ssh.md#generate-an-ssh-key-pair).
|
|
|
|
|
|
|
|
|
|
|
|
# ⏬ 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 source code from this repository with the following command:
|
|
|
|
|
|
|
|
```
|
|
|
|
git clone git@gitlab.uliege.be:rboman/math0471.git
|
| ... | ... | @@ -149,6 +154,8 @@ git clone git@gitlab.uliege.be:rboman/math0471.git |
|
|
|
|
|
|
|
# 📝 Learn git
|
|
|
|
|
|
|
|
The following list of commands is a summary of what will be interactively presented in class.
|
|
|
|
|
|
|
|
### 🌿 Basic git workflow
|
|
|
|
|
|
|
|
Create a repository:
|
| ... | ... | @@ -253,7 +260,7 @@ Create a "merge request" (instead of pushing to the main branch named `main` - i |
|
|
|
* The other developers will receive an e-mail telling them that you want to update `main`.
|
|
|
|
* Wait for their comments and agreement before merging the merge request.
|
|
|
|
|
|
|
|
Tag your project for a deadline (a "tag" is a string which identifies a particular commit of your project):
|
|
|
|
Tag your project for a deadline. A "tag" is a character string which identifies a particular commit of your project, such as `v1.0`, `deadline_1` or `final_report`:
|
|
|
|
|
|
|
|
* Do this on GitLab.
|
|
|
|
|
| ... | ... | @@ -278,7 +285,7 @@ If you prefer youtube videos, here are some links about git and GitLab: |
|
|
|
|
|
|
|
# 💡 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.
|
|
|
|
* Keep the `main` branch stable (it should always produce no errors during the build and all the tests should run successfully!).
|
|
|
|
* Tell what you are currently doing to the other developers (using comments, issues, merge requests on GitLab... or by any other mean such as messenger, e-mails or, even better, face-to-face).
|
|
|
|
* Most of the previous commands are integrated into [VS Code](Visual%20Studio%20Code). You can easily see the modified files, prepare a commit or resolve conflicts (through the GUI, with your mouse!). |
|
|
\ No newline at end of file |
|
|
|
* Do not push unnecessary files! Add a [.gitignore](https://gitlab.uliege.be/rboman/math0471/-/blob/master/.gitignore?ref_type=heads) to your project. This file contains all the file patterns that should be ignored by git (e.g. `*.exe` for executables or `build/` for build folders). 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!). This is critical because you continuously want to have a stable reference version of your program.
|
|
|
|
* Communication with your teammates is very important: tell what you are currently doing to the other developers (using comments, issues, merge requests on GitLab... or by any other mean such as Messenger, Discord, Teams, e-mails or, even better, face-to-face).
|
|
|
|
* Most of the git commands are integrated into [VS Code](Visual%20Studio%20Code) as buttons and commands in menus. You can easily see the modified files, prepare a commit or resolve conflicts (through the GUI, with your mouse!). |
|
|
\ No newline at end of file |