Skip to content
Snippets Groups Projects
Commit c2fb5ce0 authored by Laurent Heirendt's avatar Laurent Heirendt :airplane:
Browse files

minor changes

parent 3d9152b5
No related branches found
No related tags found
No related merge requests found
...@@ -17,9 +17,9 @@ $ git push <remote> <branch> ...@@ -17,9 +17,9 @@ $ git push <remote> <branch>
``` ```
## Pull the latest version of an existing repository ## Pull the latest version of an existing branch
Then, pull the latest revision: Pull the latest revision on branch `add-2-numbers`:
```bash ```bash
$ git pull origin add-2-numbers $ git pull origin add-2-numbers
# Already up to date # Already up to date
...@@ -46,7 +46,7 @@ $ mv addTwoNumbers.m addTwoNumbers_myName.m ...@@ -46,7 +46,7 @@ $ mv addTwoNumbers.m addTwoNumbers_myName.m
Open the file using the `Visual Studio Code` editor (or any other editor) Open the file using the `Visual Studio Code` editor (or any other editor)
and correct the line and correct the line
```Matlab ```Matlab
c = a + b; c = a - b;
``` ```
...@@ -62,7 +62,8 @@ $ git status ...@@ -62,7 +62,8 @@ $ git status
<br> <br>
Now, add the file (bring it on stage) Now, add the file (bring it on stage)
```bash ```bash
$ git add firstCommit/addTwoNumbers_myName.m $ git add addTwoNumbers_myName.m
$ git status
# returns the same as before, generally in green (means staged) # returns the same as before, generally in green (means staged)
``` ```
...@@ -78,21 +79,15 @@ exit with `q` ...@@ -78,21 +79,15 @@ exit with `q`
## Add a commit message ## Add a commit message
```bash ```bash
$ git commit -m "Uncommented line for adding 2 numbers" $ git commit -m "Correcting formula for adding 2 numbers"
$ git status $ git status
``` ```
<br>
You can pull, even at this stage, new possible changes
```bash
$ git pull
```
## Push your file to the repository ## Push your file to your fork
```bash ```bash
$ git push $ git push origin add-2-numbers
``` ```
<div class="fragment"> <div class="fragment">
...@@ -106,19 +101,21 @@ exit by typing `q` ...@@ -106,19 +101,21 @@ exit by typing `q`
## Do it yourself ## Do it yourself
* Modify and rename `secondCommit/multiplyTwoNumbers.m` * Modify and rename `secondCommit/multiplyTwoNumbers_myName.m`
* Push the file `secondCommit/multiplyTwoNumbers_myName.m` * Push the file `secondCommit/multiplyTwoNumbers_myName.m`
* Don't forget to add <font color="red">`_myName`</font> * Don't forget to edit <font color="red">`_myName`</font>
<div class="fragment"> <div class="fragment">
<br> <br>
Commands: Commands:
```bash ```bash
$ git pull $ git checkout develop
$ git diff # optional $ git pull origin develop
$ git checkout -b multiply-2-numbers
# make changes to file
$ git add secondCommit/multiplyTwoNumbers_myName.m $ git add secondCommit/multiplyTwoNumbers_myName.m
$ git commit -m "Uncommented line for multiplying 2 numbers" $ git commit -m "Corrected formula for multiplying 2 numbers"
$ git status $ git status
$ git push $ git push origin multiply-2-numbers
$ git log # optional $ git log # optional
``` ```
...@@ -13,20 +13,20 @@ Don't forget to properly configure `git` with your username and email as explain ...@@ -13,20 +13,20 @@ Don't forget to properly configure `git` with your username and email as explain
## Task ## Task
- create a fork of the repository <br>https://git-r3lab.uni.lu/R3/R3.practice - create a fork of the repository <br>https://git-r3lab.uni.lu/R3school/git.practice
- commit some code - commit some code
- create a merge request on `GitLab`. - create a merge request on `GitLab`.
## Detailed instructions ## Detailed instructions
- First, fork the [https://git-r3lab.uni.lu/R3/R3.practice](https://git-r3lab.uni.lu/R3/R3.practice) repository. - First, fork the [https://git-r3lab.uni.lu/R3school/git.practice](https://git-r3lab.uni.lu/R3school/git.practice) repository.
- Create the new branch `homework_myName`. - Create the new branch `homework_myName`.
- Implement a new function (create a new file `sqrt_myName.m`) called `sqrt_myName(x)` that computes the square root of `x`. - Implement a new function (create a new file `sqrt_myName.m` in a new folder `src/thirdCommit`) called `sqrt_myName(x)` that computes the square root of `x`.
- Rename the `test.m` file in the `test/` directory to `test_myName.m`. - Rename the `test.m` file in the `test/suite` directory to `test_myName.m`.
- Edit the file `test.m` and change the names of the functions accordingly. - Edit the file `test.m` and change the names of the functions accordingly.
......
Absolute Beginners<br> <img src="img/Git-Logo-Black.png" class="as-is" height="100px"><br>Training for absolute beginners
<img src="img/Git-Logo-Black.png" class="as-is" height="100px"><br>Workshop
<br>
<img src="img/logoLCSB.png" class="as-is" height="100px"> <img src="img/r3-training-logo.png" class="as-is" height="200px">
<br><br><br><br> <br><br><br><br>
<br><br> <br><br>
......
## Merge a branch ## Merge a branch
If you want your feature on the `develop` or `master` branches, If you want your feature on the `develop` or `master` branches,
...@@ -9,35 +8,9 @@ Use the **interface** to make use of your peers to review your code! ...@@ -9,35 +8,9 @@ Use the **interface** to make use of your peers to review your code!
<img src="img/branch-merge.png" class="branch-merge" /> <img src="img/branch-merge.png" class="branch-merge" />
<br> <br>
Once merged, you can delete the branch via the interface. Once merged, you can delete the branch via the interface.
<br>
## Github interface (Live Demo)
<img src="https://assets-cdn.github.com/images/modules/logos_page/GitHub-Mark.png" alt="GitHub" style="width: 100px;"/> \ No newline at end of file
Detailed information is on [help.github.com/articles/creating-a-pull-request/](https://help.github.com/articles/creating-a-pull-request/).
1. Click on **New pull request**
![New pull request](https://help.github.com/assets/images/help/pull_requests/pull-request-start-review-button.png)
<br><br>
2. Compare the branches
![Compare branches](https://help.github.com/assets/images/help/pull_requests/choose-base-and-compare-branches.png)
<ol start="3">
<li>Assign your peer
<br>
![Assigning a peer](https://help.github.com/assets/images/help/issues/issues_assigning_dropdown.png)
</li>
</ol>
<ol start="4">
<li>Submit the PR
![Submit MR](https://help.github.com/assets/images/help/pull_requests/pullrequest-send.png)</li>
</ol>
...@@ -30,3 +30,12 @@ https://git-scm.com/book/en/v2 ...@@ -30,3 +30,12 @@ https://git-scm.com/book/en/v2
<br>[3]: Cheat sheet: http://rogerdudler.github.io/git-guide <br>[3]: Cheat sheet: http://rogerdudler.github.io/git-guide
## Thank you.
<img src="img/r3-training-logo.png" height="200px">
Contact us if you need help:
r3lab.core@uni.lu
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment