diff --git a/slides/branches.md b/slides/branches.md index c5bcbc503c347a090f4b9659da8e6ad9b1573f07..bbfddb58455f71c5bb2044d8f6ce52b772aaf6ad 100644 --- a/slides/branches.md +++ b/slides/branches.md @@ -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) diff --git a/slides/essential_commands.md b/slides/essential_commands.md index e5538db5d9f1451461f28dba9f02836225247768..8da014a860cffd4222990bd3eb3bc1ac2f95328b 100644 --- a/slides/essential_commands.md +++ b/slides/essential_commands.md @@ -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> diff --git a/slides/img/branch-create.png b/slides/img/branch-create.png index bc5e5476089018f4b94363b5e376a7b17c54785c..4ae4e4d42e620d49c6b5592037767805bd5b2188 100644 Binary files a/slides/img/branch-create.png and b/slides/img/branch-create.png differ diff --git a/slides/img/branch-i-state.graffle b/slides/img/branch-i-state.graffle index 56bb4d448e63187a446bf1997fac02a5150dabc7..1963daeff8e3b784c6806fc829b9172f05f9f3e4 100644 Binary files a/slides/img/branch-i-state.graffle and b/slides/img/branch-i-state.graffle differ