diff --git a/.gitmodules b/.gitmodules index e17a7c00895b772f69e98820d9d673f01d1bea43..6bbba0db10c8a6a1063d29275c16703a970b10d4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,5 @@ [submodule "theme"] path = theme - url = https://git-r3lab.uni.lu/R3/outreach/theme.git + url = https://git-r3lab.uni.lu/R3/outreach/theme.git + + diff --git a/2019/2019-09-09_testCourseAdv/slides/amendIntro.md b/2019/2019-09-09_testCourseAdv/slides/amendIntro.md new file mode 100644 index 0000000000000000000000000000000000000000..82e827983bc712b3a74922ed2a6a6d0e55ab818f --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/amendIntro.md @@ -0,0 +1,3 @@ +# Theory: Git Amend + +* Enables to change the specifics of the commit on HEAD (the last commit) \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/amendPresentation1.md b/2019/2019-09-09_testCourseAdv/slides/amendPresentation1.md new file mode 100644 index 0000000000000000000000000000000000000000..3875c453a94d003f849d858bfb0971860b642ff4 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/amendPresentation1.md @@ -0,0 +1,13 @@ +# Practical: Git Amend + +* Start by creating and committing a file +```bash +$ echo "This file contains errors and needs to be amended" > amend.txt +$ git add amend.txt +$ git commit -m "this file needs to be amended" +``` + +* Check the commit +```bash +$ git log +``` \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/amendPresentation2.md b/2019/2019-09-09_testCourseAdv/slides/amendPresentation2.md new file mode 100644 index 0000000000000000000000000000000000000000..53d82aba273b0f16e8b5324a6dd7814922462fd0 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/amendPresentation2.md @@ -0,0 +1,16 @@ +# Practical: Git Amend - Commit Message + +* Verify that your staging area is clear: +```bash +$ git status +``` + +* use the `commit --amend` with the `-m` flag to edit only the commit message: +```bash +$ git commit --amend -m "This commit title has been amended" +``` + +* See the commit message in the log has changed: +```bash +$ git log +``` diff --git a/2019/2019-09-09_testCourseAdv/slides/amendPresentation3.md b/2019/2019-09-09_testCourseAdv/slides/amendPresentation3.md new file mode 100644 index 0000000000000000000000000000000000000000..bae91bc9b90b972b3eb7ea9cd6518da06e9c6cf1 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/amendPresentation3.md @@ -0,0 +1,19 @@ +# Practical: Git Amend - Commit Content + +* In your editor, change the text in the amend.txt file: +```bash +"This file's content have been corrected" +``` + +* Check if the changed file is in the staging area: +```bash +$ git status +``` + +* With the changes stages use the following command to commit the changes into the previous commit: +```bash +$ git commit --amend -no-edit +``` + +* This will create and commit a new commit with the staged changes added. +* Force push your changes to develop diff --git a/2019/2019-09-09_testCourseAdv/slides/chPickIntro.md b/2019/2019-09-09_testCourseAdv/slides/chPickIntro.md new file mode 100644 index 0000000000000000000000000000000000000000..eb8f63f84a705ac686d3ac616f6c69d968ab6a5d --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/chPickIntro.md @@ -0,0 +1,11 @@ +# Theory: Git Cherry-picking + +* It enables the user to pick specific commits from a list of commits. + +Careful! +Cherry picking only picks the selected commit, +not everything up to that commit. + +<div style="top: 15em; left: 30%; position: absolute;"> + <img src="slides/img/cherryPick.png"> +</div> \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/chPickPresentation1.md b/2019/2019-09-09_testCourseAdv/slides/chPickPresentation1.md new file mode 100644 index 0000000000000000000000000000000000000000..5f5fe387b29daf0795b6def5b3e668fa319182a3 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/chPickPresentation1.md @@ -0,0 +1,18 @@ +# Practical: Git Cherry-picking + +* In your branch, create and commit a reference file +```bash +$ echo "This is the start of a commit chain" > reference.txt +$ git add reference.txt +$ git commit origin myBranch +``` + +* Create and commit two files in the develop branch +```bash +$ echo "This is a commit to keep" > keep.txt +$ git add keep.txt +$ git commit origin develop +$ echo "Ignore this commit" > ignore.txt +$ git add ignore.txt +$ git commit origin develop +``` \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/chPickPresentation2.md b/2019/2019-09-09_testCourseAdv/slides/chPickPresentation2.md new file mode 100644 index 0000000000000000000000000000000000000000..910ac9ee75c8cce96ddfe71891f52d5f957af2a5 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/chPickPresentation2.md @@ -0,0 +1,16 @@ +# Practical: Git Cherry-picking + +* Check the commit reference of the two commits in develop +* Chose the commit to keep and add it to your branch +```bash +$ git checkout myBranch +$ git cherry-pick <commit reference> +``` +* Check the log again and see if the changes were applied correctly + +* push the changes to the develop branch +```bash +$ git push origin myBranch -f +``` + +* The `-f` flag is used to force push into develop \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/conflictIntro.md b/2019/2019-09-09_testCourseAdv/slides/conflictIntro.md new file mode 100644 index 0000000000000000000000000000000000000000..8970946b00c0737ea3ea87f62fe041c6b6a57136 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/conflictIntro.md @@ -0,0 +1,9 @@ +# Theory: Conflict resolution + +* A conflict emerges when two files push two different changes +to a one target branch + +* Some conflict may be resolved automatically, but major conflicts +always need to be resolved manually + +* Tools exist to streamline conflict resolutions, we use kdiff3 \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/conflictPresentation1.md b/2019/2019-09-09_testCourseAdv/slides/conflictPresentation1.md new file mode 100644 index 0000000000000000000000000000000000000000..baeb3790aa5096f07c80937e31ee3363608806c1 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/conflictPresentation1.md @@ -0,0 +1,27 @@ +# Practical: Conflict resolution using kdiff3 + +* create a branch named changeMicheal and in the editor you change +the content of `Michael.md`: +```bash +$ git checkout develop +$ git checkout -b changeMichael +``` + +Change Michael file... + +```bash +$ git fetch upstream +$ git checkout develop +$ git merge upstream/develop +``` + +summary: +michael.md on develop: +``` +# Michael +``` + +michael.md on changeMichael (example) +``` +## Michael Evans +``` \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/conflictPresentation2.md b/2019/2019-09-09_testCourseAdv/slides/conflictPresentation2.md new file mode 100644 index 0000000000000000000000000000000000000000..9977864539b71d208631e49665741b898ff4a951 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/conflictPresentation2.md @@ -0,0 +1,16 @@ +# Practical: Conflict resolution using kdiff3 + +If then there is a rebase done on develop: +```bash +$ git rebase develop +``` +A conflict should emerge + +* When facing the merge conflict message, use the command +```bash +$ git mergetool +``` + +* This opens kdiff3 if it was properly set up. Selecting A will keep the changes of the target branch, +while B will keep your changes. Selecting A and B will combine both changes to the merged file. + diff --git a/2019/2019-09-09_testCourseAdv/slides/conflictPresentation3.md b/2019/2019-09-09_testCourseAdv/slides/conflictPresentation3.md new file mode 100644 index 0000000000000000000000000000000000000000..93df0456d57009fd3b77af11168ceb0537d7b1b5 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/conflictPresentation3.md @@ -0,0 +1,16 @@ +# Practical: Conflict resolution using kdiff3 + +* After resolving the conflicts, continue in your terminal +```bash +$ git rebase --continue +``` +* Then check the status: +```bash +$ git status +``` + +* It shows you a `.orig` file. This `.orig` file contains information about the conflict. +```bash +$ rm _attendees/michael.md.orig +``` +* You can either `rm` the `.orig` file, or you can use `git clean -fdx`. \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/gettingStarted.md b/2019/2019-09-09_testCourseAdv/slides/gettingStarted.md new file mode 100644 index 0000000000000000000000000000000000000000..64939ea079036a4a8bc93e145b491efa34abaaa7 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/gettingStarted.md @@ -0,0 +1,18 @@ +# Getting Started + +Fork and clone the tutorial repository +```bash +$ git clone ssh://git@git-r3lab-server.uni.lu:8022/<yourName>/presentations-internal.git +``` +Add a remote upstream +```bash +$ git remote add upstream ssh://git@git-r3lab-server.uni.lu:8022/R3/school/advanced-git/presentations-internal.git +``` +Go to the develop branch +```bash +$ git checkout develop +``` +And create your own branch using the `-b` flag +```bash +$ git checkout -b myNameBranch +``` \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/headRebase-iIntro.md b/2019/2019-09-09_testCourseAdv/slides/headRebase-iIntro.md new file mode 100644 index 0000000000000000000000000000000000000000..01d0cdd1e25e94579f573ba93732b8525ea71121 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/headRebase-iIntro.md @@ -0,0 +1,7 @@ +# Theory: Amending with Git Rebase + +* The same operations can be made with `git rebase -i` + +* The flag HEAD~X will let you amend the X previous commits instead of just the last one + +* In the Interactive rebase menu, be sure to select the `edit` option. \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/headRebase-iPresentation.md b/2019/2019-09-09_testCourseAdv/slides/headRebase-iPresentation.md new file mode 100644 index 0000000000000000000000000000000000000000..45717dc4f6dd5b69d35b044da4d74c38e20ee7cb --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/headRebase-iPresentation.md @@ -0,0 +1,5 @@ +# Practical: Amending with Git Rebase + +```bash +$ git rebase -i HEAD~3 +``` \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/img/afterRebase.png b/2019/2019-09-09_testCourseAdv/slides/img/afterRebase.png new file mode 100644 index 0000000000000000000000000000000000000000..f95a60255e4767c16a2e438f9f84b9ae11e47b09 Binary files /dev/null and b/2019/2019-09-09_testCourseAdv/slides/img/afterRebase.png differ diff --git a/2019/2019-09-09_testCourseAdv/slides/img/beforeRebase.png b/2019/2019-09-09_testCourseAdv/slides/img/beforeRebase.png new file mode 100644 index 0000000000000000000000000000000000000000..50faf148c894bbfffc3b684b6865386cf338787e Binary files /dev/null and b/2019/2019-09-09_testCourseAdv/slides/img/beforeRebase.png differ diff --git a/2019/2019-09-09_testCourseAdv/slides/img/cherryPick.png b/2019/2019-09-09_testCourseAdv/slides/img/cherryPick.png new file mode 100644 index 0000000000000000000000000000000000000000..1ba2349aea0e88defdbd531048bcdfe02efa0ef7 Binary files /dev/null and b/2019/2019-09-09_testCourseAdv/slides/img/cherryPick.png differ diff --git a/2019/2019-09-09_testCourseAdv/slides/img/favicon.ico b/2019/2019-09-09_testCourseAdv/slides/img/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..9b935c03f6f841601835db006ed02b582166cdc8 Binary files /dev/null and b/2019/2019-09-09_testCourseAdv/slides/img/favicon.ico differ diff --git a/2019/2019-09-09_testCourseAdv/slides/img/r3-training-logo.png b/2019/2019-09-09_testCourseAdv/slides/img/r3-training-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..48a3aeaa54640a2bde1d4534dd9922d2ea90840c Binary files /dev/null and b/2019/2019-09-09_testCourseAdv/slides/img/r3-training-logo.png differ diff --git a/2019/2019-09-09_testCourseAdv/slides/index.md b/2019/2019-09-09_testCourseAdv/slides/index.md new file mode 100644 index 0000000000000000000000000000000000000000..8c0183b1210dd5d20617786f94b84116de5111cf --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/index.md @@ -0,0 +1,19 @@ +# Advanced Git Training + +## August 21st, 2019 + +<div style="top: 6em; left: 0%; position: absolute;"> + <img src="theme/img/lcsb_bg.png"> +</div> + +<div style="top: 5em; left: 60%; position: absolute;"> + <img src="slides/img/r3-training-logo.png" height="200px"> + <br><br><br> + <h1>Git Advanced Tutorial</h1> + <br><br><br> + <h4> + Daniel Tojal, Title<br><br> + daniel.duarte.001@student.uni.lu<br><br> + <i>Luxembourg Centre for Systems Biomedicine</i> + </h4> +</div> \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/kdiff3Install1.md b/2019/2019-09-09_testCourseAdv/slides/kdiff3Install1.md new file mode 100644 index 0000000000000000000000000000000000000000..cf1e4c1e5b13a6b770b6ba1c22f0bea06b75a753 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/kdiff3Install1.md @@ -0,0 +1,7 @@ +# Installing kdiff3 + +* Recommended tool: KDiff3 + +* Download it here: https://sourceforge.net/projects/kdiff3/files/ + +* The downloadable file should match your OS \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/kdiff3Install2.md b/2019/2019-09-09_testCourseAdv/slides/kdiff3Install2.md new file mode 100644 index 0000000000000000000000000000000000000000..13dba2156e6b36f5fae40a68c73c25e5abab2c1f --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/kdiff3Install2.md @@ -0,0 +1,13 @@ +# Setting up kdiff3 + +```bash +git config --global --add merge.tool kdiff3 +git config --global --add mergetool.kdiff3.path " <Kdiff3 path> " +git config --global --add mergetool.kdiff3.trustExitCode false + +git config --global --add diff.guitool kdiff3 +git config --global --add difftool.kdiff3.path " <Kdiff3 path> " +git config --global --add difftool.kdiff3.trustExitCode false +``` + +* omit `""` when setting up on linux or mac \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/list.json b/2019/2019-09-09_testCourseAdv/slides/list.json new file mode 100644 index 0000000000000000000000000000000000000000..da1d468fe4809fe89acffade55fe329943651d93 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/list.json @@ -0,0 +1,177 @@ +[ + { + "filename": "index.md", + "attr": { + } + }, + { + "filename": "overview.md", + "attr": { + } + }, + { + "filename": "gettingStarted.md", + "attr": { + } + }, + { + "filename": "rebaseIntro.md", + "attr": { + } + }, + { + "filename": "rebaseIntro2.md", + "attr": { + } + }, + { + "filename": "rebasePresentation1.md", + "attr": { + } + }, + { + "filename": "rebasePresentation2.md", + "attr": { + } + }, + { + "filename": "rebase-iIntro.md", + "attr": { + } + }, + { + "filename": "rebase-iPresentation1.md", + "attr": { + } + }, + { + "filename": "rebase-iPresentation2.md", + "attr": { + } + }, + { + "filename": "rebase-iPresentation3.md", + "attr": { + } + }, + { + "filename": "rebase-iPresentation4.md", + "attr": { + } + }, + { + "filename": "chPickIntro.md", + "attr": { + } + }, + { + "filename": "chPickPresentation1.md", + "attr": { + } + }, + { + "filename": "chPickPresentation2.md", + "attr": { + } + }, + { + "filename": "revertIntro.md", + "attr": { + } + }, + { + "filename": "revertPresentation.md", + "attr": { + } + }, + { + "filename": "resetIntro.md", + "attr": { + } + }, + { + "filename": "resetPresentation.md", + "attr": { + } + }, + { + "filename": "amendIntro.md", + "attr": { + } + }, + { + "filename": "amendPresentation1.md", + "attr": { + } + }, + { + "filename": "amendPresentation2.md", + "attr": { + } + }, + { + "filename": "amendPresentation3.md", + "attr": { + } + }, + { + "filename": "headRebase-iIntro.md", + "attr": { + } + }, + { + "filename": "headRebase-iPresentation.md", + "attr": { + } + }, + { + "filename": "mergeIntro.md", + "attr": { + } + }, + { + "filename": "mergePresentation1.md", + "attr": { + } + }, + { + "filename": "mergePresentation2.md", + "attr": { + } + }, + { + "filename": "conflictIntro.md", + "attr": { + } + }, + { + "filename": "kdiff3Install1.md", + "attr": { + } + }, + { + "filename": "kdiff3Install2.md", + "attr": { + } + }, + { + "filename": "conflictPresentation1.md", + "attr": { + } + }, + { + "filename": "conflictPresentation2.md", + "attr": { + } + }, + { + "filename": "conflictPresentation3.md", + "attr": { + } + }, + { + "filename": "thanks.md", + "attr": { + } + } +] diff --git a/2019/2019-09-09_testCourseAdv/slides/mergeIntro.md b/2019/2019-09-09_testCourseAdv/slides/mergeIntro.md new file mode 100644 index 0000000000000000000000000000000000000000..7212c55fd5cac807984cd64a304695c963ae76ed --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/mergeIntro.md @@ -0,0 +1,3 @@ +# Theory: Merging branches + +* Combines all the commits from a source branch onto a target branch \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/mergePresentation1.md b/2019/2019-09-09_testCourseAdv/slides/mergePresentation1.md new file mode 100644 index 0000000000000000000000000000000000000000..cdcd0815beaa76dacde76e67809c86a841e0b45e --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/mergePresentation1.md @@ -0,0 +1,18 @@ +# Practical: Merging branches + +* Create a new branch from your own branch: +```bash +$ git checkout -b Feature1 +``` + +* Add two files to the Feature1 branch in two separate commits: +```bash +$ echo "Code that is merged into myBranch" > merge1.txt +$ git add merge1.txt +$ git commit -m "first commit to be merged" +``` +```bash +$ echo "Code that is merged into myBranch" > merge2.txt +$ git add merge2.txt +$ git commit -m "second commit to be merged" +``` \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/mergePresentation2.md b/2019/2019-09-09_testCourseAdv/slides/mergePresentation2.md new file mode 100644 index 0000000000000000000000000000000000000000..5683ccf3ff0f05ff203fc1befda0e7f4a9b74d29 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/mergePresentation2.md @@ -0,0 +1,14 @@ +# Practical: Merging branches + +* Check the commit log of the myBranch and Feature1 branch +```bash +$ git log +``` + +* Go to myBranch and merge the Feature1 branch into it +```bash +$ git merge Feature1 +``` + +* This will move all changes made in the Feature1 branch +onto myBranch, effectively fusing the two together. \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/overview.md b/2019/2019-09-09_testCourseAdv/slides/overview.md new file mode 100644 index 0000000000000000000000000000000000000000..3509be169c2e91ad8b6777ba1421cafb38a3d0a2 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/overview.md @@ -0,0 +1,17 @@ +# Overview + +1. Rebasing in Git: Theory +1. Rebasing in Git: Practical +2. Git cherry-picking: Theory +2. Git cherry-picking: Practical +3. Reverting commits: Theory +3. Reverting commits: Practical +4. Resetting to a previous commit: Theory +4. Resetting to a previous commit: Practical +5. Amend last commit: Theory +5. Amend last commit: Practical +6. Amending using Interactive rebasing +7. Merging branches: Theory +7. Merging branches: Practical +8. Conflict Resolution: Theory +8. Conflict Resolution: Practical \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/rebase-iIntro.md b/2019/2019-09-09_testCourseAdv/slides/rebase-iIntro.md new file mode 100644 index 0000000000000000000000000000000000000000..6616993802bd0b2137dc8ed080e7b98b9f006f35 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/rebase-iIntro.md @@ -0,0 +1,17 @@ +# Theory: Git Interactive Rebasing + +```bash +git rebase -i <branch> +``` + +* Enables more precise control over the rebased commits +* Before committing many actions are at disposal + +```bash +# p, pick = use commit +# r, reword = use commit, but edit the commit message +# e, edit = use commit, but stop for amending +# s, squash = use commit, but meld into previous commit +# f, fixup = like "squash", but discard this commit's log message +# x, exec = run command (the rest of the line) using shell +``` \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/rebase-iPresentation1.md b/2019/2019-09-09_testCourseAdv/slides/rebase-iPresentation1.md new file mode 100644 index 0000000000000000000000000000000000000000..5b39ba0b9b3751202e27f44c01de47236bab06ed --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/rebase-iPresentation1.md @@ -0,0 +1,16 @@ +# Practical: Git Interactive Rebasing + +* Create and switch to your own branch +* Add and commit two files to this branch: + +```bash +$ echo "# Michael" > Michael.md +$ git add Michael.md +$ git commit -m "Add Michael to the list of attendees" +$ git push origin yourBranch + +$ echo "# Kevin" > Kevin.md +$ git add Kevin.md +$ git commit -m "Add Kevin to the list of attendees" +$ git push origin yourBranch +``` \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/rebase-iPresentation2.md b/2019/2019-09-09_testCourseAdv/slides/rebase-iPresentation2.md new file mode 100644 index 0000000000000000000000000000000000000000..bbd369a8b33fd585c05e11857b31fc5078abe909 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/rebase-iPresentation2.md @@ -0,0 +1,12 @@ +# Practical: Git Interactive Rebasing + +* Perform an interactive rebase with the two last commits: + +```bash +$ git rebase -i HEAD~2 +``` + +* reword the first commit's message to: +`These are the two squashed commits` +* combine the second and first commit into one, +omitting the second's commit message. \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/rebase-iPresentation3.md b/2019/2019-09-09_testCourseAdv/slides/rebase-iPresentation3.md new file mode 100644 index 0000000000000000000000000000000000000000..777f04282eac562798802cd6d621f82dfe8a2ed3 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/rebase-iPresentation3.md @@ -0,0 +1,23 @@ +# Practical: Git Interactive Rebasing + +The prompt shows up: +```bash +$ pick 1234567 add Micheal to attendee list +$ pick abcdef0 add Kevin to attendee list +``` + +The keywords should be changed to: +```bash +$ reword 1234567 add Micheal to attendee list +$ fixup abcdef0 add Kevin to attendee list +``` + +Upon confirming, change the message of commit 1234567: +```bash +$ Add Micheal and Kevin to the attendee list +``` + +Then use force-push to push your changes: +```bash +$ git push origin myBranch -f +``` \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/rebase-iPresentation4.md b/2019/2019-09-09_testCourseAdv/slides/rebase-iPresentation4.md new file mode 100644 index 0000000000000000000000000000000000000000..5a8a163051f025adfea8fcae4d7a601c6ab5bdef --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/rebase-iPresentation4.md @@ -0,0 +1,9 @@ +# Practical: Git Interactive Rebasing + +* If you wanted to keep both commit messages in one commit, instead change the prompts to squashing instead +```bash +$ pick 1234567 add Micheal to attendee list +$ squash abcdef0 add Kevin to attendee list +``` + +* This will create a commit with both files still in, but the commit message of that commit will be the two commit messages of the two files combined. \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/rebaseIntro.md b/2019/2019-09-09_testCourseAdv/slides/rebaseIntro.md new file mode 100644 index 0000000000000000000000000000000000000000..343f11f378e40ca8ffae163d7989bff1c61c3f33 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/rebaseIntro.md @@ -0,0 +1,10 @@ +# Theory: Git Rebasing + +* Git rebase enables to keep up with changes made to a branch +* Straightens the workflow +* Avoid discrepancies when multiple people work on the same project + +Imagine the following situation: +<div style="top: 10em; left: 30%; position: absolute;"> + <img src="slides/img/beforeRebase.png" height="400px"> +</div> \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/rebaseIntro2.md b/2019/2019-09-09_testCourseAdv/slides/rebaseIntro2.md new file mode 100644 index 0000000000000000000000000000000000000000..4ada0e92ca662cf348fdbcbc1f5b0e78b81655c0 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/rebaseIntro2.md @@ -0,0 +1,8 @@ +# Theory: Git Rebasing + +* Develop branch is several commits ahead of master. +* Commits implemented into master that aren't in develop. + +<div style="top: 10em; left: 30%; position: absolute;"> + <img src="slides/img/afterRebase.png" height="400px"> +</div> \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/rebasePresentation1.md b/2019/2019-09-09_testCourseAdv/slides/rebasePresentation1.md new file mode 100644 index 0000000000000000000000000000000000000000..c2cb343325f345e758339134093b826a94788668 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/rebasePresentation1.md @@ -0,0 +1,18 @@ +# Practical: Git Rebasing + +* Create a file in your branch +```bash +$ git checkout myBranch +$ echo "# message" > yourName.md +``` + +* Then create a file in the develop branch +```bash +$ git checkout develop +$ touch startRebase.txt +``` + +* Check the histories of both branches +```bash +$ git log +``` diff --git a/2019/2019-09-09_testCourseAdv/slides/rebasePresentation2.md b/2019/2019-09-09_testCourseAdv/slides/rebasePresentation2.md new file mode 100644 index 0000000000000000000000000000000000000000..25c1687edf9fade70a07bbbe45d6e6e2b42d18c3 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/rebasePresentation2.md @@ -0,0 +1,12 @@ +# Practical: Git Rebasing + +* rebase the develop branch onto your branch +```bash +$ git checkout myBranch +$ git rebase develop +``` + +* check the history of your branch again +```bash +$ git log +``` \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/resetIntro.md b/2019/2019-09-09_testCourseAdv/slides/resetIntro.md new file mode 100644 index 0000000000000000000000000000000000000000..e9b050691b6e709cf7554ed301587195a761b9ec --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/resetIntro.md @@ -0,0 +1,4 @@ +# Theory: Git Reset + +* Enables to reset back to a previous commit HEAD +* Discards ALL commits made after the selected commit HEAD \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/resetPresentation.md b/2019/2019-09-09_testCourseAdv/slides/resetPresentation.md new file mode 100644 index 0000000000000000000000000000000000000000..0a358b62dae88fc7509c78d2956538eb4babb545 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/resetPresentation.md @@ -0,0 +1,23 @@ +# Practical: Git Reset + +* Start by committing two files: +```bash +$ echo "This file is the one we want to keep" > header.txt +$ git add header.txt +$ git commit -m "Reset here" +``` +```bash +$ echo "This file contains faulty code" > undo.txt +$ git add undo.txt +$ git commit -m "Undo this commit" +``` +* Check the commits again and copy the relevant commit header: +```bash +$ git log +``` +* Use the `reset --hard` command in order to undo the faulty commit: +```bash +$ git reset --hard <sha1> +``` +* Check what happened in the log +* Force push your now solitary commit to develop \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/revertIntro.md b/2019/2019-09-09_testCourseAdv/slides/revertIntro.md new file mode 100644 index 0000000000000000000000000000000000000000..015ae5aeda4d3a498d2529b154c3fa16a138fb07 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/revertIntro.md @@ -0,0 +1,3 @@ +# Theory: Git Revert + +* Enables the deletion of committed commits \ No newline at end of file diff --git a/2019/2019-09-09_testCourseAdv/slides/revertPresentation.md b/2019/2019-09-09_testCourseAdv/slides/revertPresentation.md new file mode 100644 index 0000000000000000000000000000000000000000..7c5d40ce3df750f2008a761d396860ca0712bef0 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/revertPresentation.md @@ -0,0 +1,16 @@ +# Practical: Git Revert + +* On your branch, create and commit a file: +```bash +$ echo "# This commits contains errors" > revert.txt +$ git add revert.txt +$ git commit -m "Error" +``` +* check the commit log and copy the `Error` commit ID: +```bash +$ git log +``` +* Use the 'git revert' command to undo this selected commit: +```bash +$ git revert <sha1> +``` diff --git a/2019/2019-09-09_testCourseAdv/slides/thanks.md b/2019/2019-09-09_testCourseAdv/slides/thanks.md new file mode 100644 index 0000000000000000000000000000000000000000..4867fa1e3edb10b52ef2a71e453296cffe21bab9 --- /dev/null +++ b/2019/2019-09-09_testCourseAdv/slides/thanks.md @@ -0,0 +1,8 @@ +# Thank you. + +<center><img src="slides/img/r3-training-logo.png" height="200px"></center> + +Contact us if you need help: + +<a href="mailto:r3lab.core@uni.lu">r3lab.core@uni.lu</a> + diff --git a/theme b/theme index bd2d4989f039dd7580d7ce916e38db87572e26f4..8707a9fed879305912562de34691b1e51b910852 160000 --- a/theme +++ b/theme @@ -1 +1 @@ -Subproject commit bd2d4989f039dd7580d7ce916e38db87572e26f4 +Subproject commit 8707a9fed879305912562de34691b1e51b910852