Commit 551454fb authored by Laurent Heirendt's avatar Laurent Heirendt
Browse files

slides of essential commands and branches

parent f2bc881d
......@@ -69,27 +69,26 @@ $ git checkout develop
## Create your own version
Assume that you want to work on a function for multiplying 2 numbers.
Assume that you want to work on a function for adding 2 numbers.
<div class="fragment">
<br>
<font color="red">Create a new **branch**!</font>
```bash
$ git checkout -b multiply-2-numbers
# creates the branch locally
$ git checkout -b add-2-numbers
```
The `-b` flag creates the branch.
Locally, you have your own version now:
<img src="img/branch-create.png" class="branch-create" />
Push the branch to the remote repository
Push your version to your fork:
```bash
$ git push origin multiply-2-numbers
$ git push origin add-2-numbers
```
<br>
You can use the 5 essential commands as before.
Only difference: you are on your own branch.
<img src="img/branch-commit.png" class="branch-commit" />
<br><br>
(Live Demo)
......@@ -9,11 +9,11 @@
<br>
or in other words (remember these!):
```bash
$ git pull
$ git pull <remote> <branch>
$ git status
$ git add myFile.txt # example
$ git commit -m "myMessage" # example
$ git push
$ git push <remote> <branch>
```
......@@ -21,21 +21,25 @@ $ git push
Then, pull the latest revision:
```bash
$ git pull
$ git pull origin add-2-numbers
# Already up to date
```
<div class="fragment">
<br>
Verify its `status` with:
```bash
$ git status
```
## Modify a file
Modify and rename `addTwoNumbers.m` in the folder `src/firstCommit` as `addTwoNumbers_myName`:
```bash
$ mv firstCommit/addTwoNumbers.m firstCommit/addTwoNumbers_myName.m
$ cd src/firstCommit
$ mv addTwoNumbers.m addTwoNumbers_myName.m
```
<br>
......
img/branch-create.png

56.2 KB | W: | H:

img/branch-create.png

108 KB | W: | H:

img/branch-create.png
img/branch-create.png
img/branch-create.png
img/branch-create.png
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment