Compare commits
2 commits
ee16a82965
...
21563656fd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21563656fd | ||
|
|
34cfaa26f4 |
|
|
@ -5,24 +5,24 @@
|
||||||
TeX : { extensions : ['color.js'] }
|
TeX : { extensions : ['color.js'] }
|
||||||
});
|
});
|
||||||
</script></head><body class="impress-not-supported"><div id="impress-help"></div><div class="header"><p>🪢 Braids 🪢 Introduction to git 🪢 with H&D 🪢</p></div><div id="impress"><div class="step step-level-1" step="0" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="0" data-y="0" data-z="0"><h1 id="braids-intro-to-git">🪢 Braids: Intro to git 🪢</h1><img src="assets/images/qr_hd.jpg" width="150px"></img><div class="notes"><p>Goal: introduce Git as an archiving practice,
|
</script></head><body class="impress-not-supported"><div id="impress-help"></div><div class="header"><p>🪢 Braids 🪢 Introduction to git 🪢 with H&D 🪢</p></div><div id="impress"><div class="step step-level-1" step="0" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="0" data-y="0" data-z="0"><h1 id="braids-intro-to-git">🪢 Braids: Intro to git 🪢</h1><img src="assets/images/qr_hd.jpg" width="150px"></img><div class="notes"><p>Goal: introduce Git as an archiving practice,
|
||||||
then do a little branch-based website exercise published live.</p></div></div><div class="step step-level-1" step="1" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="1600" data-y="0" data-z="0"><h1 id="planning-90-min">Planning (90 min)</h1><ol><li>Context: what git is, what it does, who uses it (5 min)</li><li>Core concepts (20 min)</li><li>Recap (5 min)</li><li>Install Git (10 min)</li><li>Core commands (15 min)</li><li>Exercise: accounts + clone/push permissions (10 min)</li><li>Exercise: branch a page, publish live, iterate (20 min)</li><li>Wrap-up: good practices + next steps (5 min)</li></ol></div><div class="step step-level-1" step="2" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="3200" data-y="0" data-z="0"><h1 id="workshop-outcome">Workshop outcome</h1><blockquote><p>Each participant will:</p><ul><li>have basic knowledge of git</li><li>clone a repository</li><li>create a branch</li><li>commit changes</li><li>push branch to our platform</li></ul></blockquote></div><div class="step step-level-1" step="3" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="4800" data-y="0" data-z="0"><h1 id="why-git">Why git?</h1><p>If you have been working on a file on your computer and the directory starts to look like this:</p><pre class="highlight code bash">motivation-letter-first-draft.odt<span class="w">
|
then do a little branch-based website exercise published live.</p></div></div><div class="step step-level-1" step="1" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="1600" data-y="0" data-z="0"><h1 id="planning-90-min">Planning (90 min)</h1><ol><li>Context: what git is, what it does, who uses it (5 min)</li><li>Core concepts (20 min)</li><li>Recap (5 min)</li><li>Install Git (10 min)</li><li>Core commands (15 min)</li><li>Exercise: accounts + clone/push permissions (10 min)</li><li>Exercise: branch a page, publish live, iterate (20 min)</li><li>Wrap-up & next steps? (5 min)</li></ol></div><div class="step step-level-1" step="2" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="3200" data-y="0" data-z="0"><h1 id="why-git">Why git?</h1><p>If you have been working on a file on your computer and the directory starts to look like this:</p><pre class="highlight code bash">motivation-letter-first-draft.odt<span class="w">
|
||||||
</span>motivation-letter.odt<span class="w">
|
</span>motivation-letter.odt<span class="w">
|
||||||
</span>motivation-letter-less-formal.odt<span class="w">
|
</span>motivation-letter-less-formal.odt<span class="w">
|
||||||
</span>motivation-letter-less-formal-comments-HvK.odt<span class="w">
|
</span>motivation-letter-less-formal-comments-HvK.odt<span class="w">
|
||||||
</span>motivation-letter-less-formal-comments-HvK-LS.odt<span class="w">
|
</span>motivation-letter-less-formal-comments-HvK-LS.odt<span class="w">
|
||||||
</span>motivation-letter-FINAL.odt<span class="w">
|
</span>motivation-letter-FINAL.odt<span class="w">
|
||||||
</span>motivation-letter-FINAL-pictures.odt<span class="w">
|
</span>motivation-letter-FINAL-pictures.odt<span class="w">
|
||||||
</span>motivation-letter-FINAL-pictures-small.odt</pre><p>Then git can be helpful!</p><blockquote><div class="notes"><p>this file has different chronological versions, features and collaborators, 3 things git is great at.</p></div></blockquote></div><div class="step step-level-1" step="4" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="6400" data-y="0" data-z="0"><h1 id="what-is-git">What is git?</h1><ul><li>git is a distributed <strong>version control system</strong></li><li>git <strong>tracks changes over time</strong> to files inside a folder</li><li>git operates in a <strong>hidden sub-folder</strong> inside the tracked folder</li><li>git enables <strong>traceability</strong> across time (history), collaboration (authorship) and experimentation (branches)</li></ul><div class="notes"><p>is the archive analogy helpful? it feels a bit like comapring something abstract with something else thats abstract</p><p>Archiving analogy:
|
</span>motivation-letter-FINAL-pictures-small.odt</pre><p>Then git can be helpful!</p><blockquote><div class="notes"><p>this file has different chronological versions, features and collaborators, 3 things git is great at.</p></div></blockquote></div><div class="step step-level-1" step="3" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="4800" data-y="0" data-z="0"><h1 id="what-is-git">What is git?</h1><ul><li>git is a distributed <strong>version control system</strong></li><li>git <strong>tracks changes over time</strong> to files inside a folder</li><li>git operates in a <strong>hidden sub-folder</strong> inside the tracked folder</li><li>git enables <strong>traceability</strong> across time (history), collaboration (authorship) and experimentation (branches)</li></ul><div class="notes"><p>is the archive analogy helpful? it feels a bit like comapring something abstract with something else thats abstract</p><p>Archiving analogy:
|
||||||
- commit = deposit with metadata
|
- commit = deposit with metadata
|
||||||
- log = inventory / finding aid
|
- log = inventory / finding aid
|
||||||
- branch = parallel dossier / alternative interpretation</p></div></div><div class="step step-level-1" step="5" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="8000" data-y="0" data-z="0"><h1 id="what-is-git-not">What is git not?</h1><ul><li>git ≠ Github!</li><li>git ≠ backup system (though it can help)</li><li>git ≠ file sync tool (though it can be used like that)</li><li>git ≠ CMS (though we use it like that today)</li><li>git ≠ magic: it records changes, you still choose what to record</li></ul><div class="notes"><p>we will see today that is git is best suited for text-based projects, especially when parsing the text is particularly useful
|
- branch = parallel dossier / alternative interpretation</p></div></div><div class="step step-level-1" step="4" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="6400" data-y="0" data-z="0"><h1 id="what-is-git-not">What is git not?</h1><ul><li>git ≠ Github!</li><li>git ≠ backup system (though it can help)</li><li>git ≠ file sync tool (though it can be used like that)</li><li>git ≠ CMS (though we use it like that today)</li><li>git ≠ magic: it records changes, you still choose what to record</li></ul><div class="notes"><p>we will see today that is git is best suited for text-based projects, especially when parsing the text is particularly useful
|
||||||
it's not a good choice for recording history on very large files (such as videos) or files where the raw textual data is illegible</p></div></div><div class="step step-level-1" step="6" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="9600" data-y="0" data-z="0"><h1 id="ecosystem">Ecosystem</h1><ul><li><strong>git</strong>: the version control system itself</li><li><strong>git hosts</strong>: platforms where git repositories are hosted<ul><li>GitHub, Bitbucket, GitLab (operated by Big Tech Giants)</li><li>Alternatives<ul><li>Codeberg (non-profit, community led)</li><li>Oxacab (riseup.net for activists, journalists)</li><li>Forgejo / Gitea (self-hosted)</li></ul></li></ul></li><li><strong>git clients</strong>: tools used to work with git on your computer<ul><li><tt>git</tt> command line tool (free & open source)</li><li><tt>tig</tt> command line tool (free & open source)</li><li>sourcetree, Github Desktop, VS Code (operated by Big Tech)</li><li>many code editors (e.g. sublime, atom) have git extensions</li><li>many, many more tools and extensions</li></ul></li></ul></div><div class="step step-level-1" step="7" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="11200" data-y="0" data-z="0"><h1 id="core-concept-commits">Core concept: Commits</h1><div class="row"><div><p>In git, a <strong>commit</strong> is a checkpoint in the repository timeline.
|
it's not a good choice for recording history on very large files (such as videos) or files where the raw textual data is illegible</p></div></div><div class="step step-level-1" step="5" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="8000" data-y="0" data-z="0"><h1 id="ecosystem">Ecosystem</h1><ul><li><strong>git</strong>: the version control system itself</li><li><strong>git hosts</strong>: platforms where git repositories are hosted<ul><li>GitHub, Bitbucket, GitLab (operated by Big Tech Giants)</li><li>Alternatives<ul><li>Codeberg (non-profit, community led)</li><li>Oxacab (riseup.net for activists, journalists)</li><li>Forgejo / Gitea (self-hosted)</li></ul></li></ul></li><li><strong>git clients</strong>: tools used to work with git on your computer<ul><li><tt>git</tt> command line tool (free & open source)</li><li><tt>tig</tt> command line tool (free & open source)</li><li>sourcetree, Github Desktop, VS Code (operated by Big Tech)</li><li>many code editors (e.g. sublime, atom) have git extensions</li><li>many, many more tools and extensions</li></ul></li></ul></div><div class="step step-level-1" step="6" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="9600" data-y="0" data-z="0"><h1 id="core-concept-commits">Core concept: Commits</h1><div class="row"><div><p>In git, a <strong>commit</strong> is a checkpoint in the repository timeline.
|
||||||
A commit contains this information:</p><ol><li><strong>What</strong> changes have taken place?</li><li><strong>Who</strong> made these changes?</li><li><strong>When</strong> were the changes made?</li><li><strong>Why</strong> were the changes made?</li><li><strong>Where</strong> was the last checkpoint?</li></ol><div class="notes"><p>Every time an author makes a set of changes that are meaningful together, she commits her changes by describing them, creating a checkpoint in the timeline to return to in the future.</p><p>The changes possible in a commit are:
|
A commit contains this information:</p><ol><li><strong>What</strong> changes have taken place?</li><li><strong>Who</strong> made these changes?</li><li><strong>When</strong> were the changes made?</li><li><strong>Why</strong> were the changes made?</li><li><strong>Where</strong> was the last checkpoint?</li></ol><div class="notes"><p>Every time an author makes a set of changes that are meaningful together, she commits her changes by describing them, creating a checkpoint in the timeline to return to in the future.</p><p>The changes possible in a commit are:
|
||||||
- editing a file
|
- editing a file
|
||||||
- adding a file
|
- adding a file
|
||||||
- removing a file
|
- removing a file
|
||||||
- renaming (moving) a file</p></div><p>Commits do not know about the timeline they are in. They only know of their preceeding commit, otherwise known as their <strong>parent</strong>.</p><p>You can always <strong>checkout</strong> a commit: visit the repository at that checkpoint on its timeline. Basically time-travel.</p></div><img src="assets/images/commits.png" width="500px"></img></div></div><div class="step step-level-1" step="8" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="12800" data-y="0" data-z="0"><h1 id="core-concept-working-areas">Core concept: Working Areas</h1><ol><li><strong>Working tree</strong>: your files right now</li><li><strong>Staging area</strong>: selection for the next commit</li><li><strong>Repository history</strong>: overview of commits</li></ol><div class="row"><img src="assets/images/working-tree.png" width="400px"></img><img src="assets/images/staging.png" width="400px"></img><img src="assets/images/timeline.png" width="400px"></img></div><div class="notes"><p>This is why Git feels "archival":
|
- renaming (moving) a file</p></div><p>Commits do not know about the timeline they are in. They only know of their preceeding commit, otherwise known as their <strong>parent</strong>.</p><p>You can always <strong>checkout</strong> a commit: visit the repository at that checkpoint on its timeline. Basically time-travel.</p></div><img src="assets/images/commits.png" width="500px"></img></div></div><div class="step step-level-1" step="7" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="11200" data-y="0" data-z="0"><h1 id="core-concept-working-areas">Core concept: Working Areas</h1><ol><li><strong>Working tree</strong>: your files right now</li><li><strong>Staging area</strong>: selection for the next commit</li><li><strong>Repository history</strong>: overview of commits</li></ol><div class="row"><img src="assets/images/working-tree.png" width="400px"></img><img src="assets/images/staging.png" width="400px"></img><img src="assets/images/timeline.png" width="400px"></img></div><div class="notes"><p>This is why Git feels "archival":
|
||||||
- you intentionally select what becomes part of the record.</p></div></div><div class="step step-level-1" step="9" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="14400" data-y="0" data-z="0"><h1 id="typical-solo-local-workflow">Typical solo local workflow</h1><ol><li><strong>You initalise a directory on your computer with git</strong>.</li><li><strong>You make changes on the directory</strong>.</li><li><strong>You stage your changes and commit them</strong>.</li><li>Repeat steps <strong>2</strong> and <strong>3</strong>.</li></ol><p><strong>Use case</strong>: tracking changes on a local, private folder, like bookkeeping.</p></div><div class="step step-level-1" step="10" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="16000" data-y="0" data-z="0"><h1 id="typical-solo-remote-workflow">Typical solo remote workflow</h1><ol><li>You clone a repository from a remote host to your local computer.</li><li>You make your changes to the repository.</li><li>You stage and commit your changes.</li><li><strong>You push (upload) your commit up to the remote</strong>.</li><li>Repeat steps <strong>2</strong>, <strong>3</strong> and <strong>4</strong></li></ol><p><strong>Use case</strong>: tracking and backing up a private folder, such as passwords.</p></div><div class="step step-level-1" step="11" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="17600" data-y="0" data-z="0"><h1 id="typical-collaborative-remote-workflow">Typical collaborative remote workflow</h1><ol><li>You clone a repository from a remote host to your local computer.</li><li>You make your changes to the repository.</li><li>You stage and commit your changes.</li><li>You push (upload) your commit up to the remote.</li><li><strong>You pull (download) other people's commits from the remote</strong>.</li><li>Repeat steps <strong>5</strong>, <strong>2</strong>, <strong>3</strong> and <strong>4</strong></li></ol><p><strong>Use case</strong>: tracking and collaborating on a repository with others such as a website project with multiple developers.</p></div><div class="step step-level-1" step="12" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="19200" data-y="0" data-z="0"><h1 id="core-concept-branching">Core concept: Branching</h1><div class="row"><div><p>In git, a <strong>branch</strong> is a named series of commits.</p><div class="notes"><p>In the previous example, there is only one branch, named "main" by default.</p></div><p>When you want to "take a detour" from the main course of a repository, you can create a separate branch.</p><div class="notes"><p>Now, parrallel timelines of the same repository exist next to each other.</p></div><p>Example <strong>use cases</strong> of branching:</p><ul><li>Experiment with a new feature affecting many files</li><li>Proposing an improvement to your collaborators</li><li>Have multiple versions of a website online</li><li>Making existing software compatible somewhere else</li></ul><div class="notes"><p>There is a lot of discourse around when to branch and how often. It varies from person to person and group to group.</p><p>From the perspective of git, since branching doesn't add any technical overload on a project, it is encouraged to branch more and branch often. From a logical perspective, every branch creates a parrallel timeline, and this might be a lot to keep track of mentally.</p><p>Branching allows for and encourages collaboration and is at the core of the free and open source software movement.</p></div></div><img src="assets/images/branching.png" width="500px"></img></div></div><div class="step step-level-1" step="13" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="20800" data-y="0" data-z="0"><h1 id="core-concept-merging">Core concept: Merging</h1><div class="row"><div><p>In git, <strong>merging</strong> is when you consolidate commits from a separate branch into your own.</p><div class="notes"><p>There are various merging techniques, and most of the time, the automated algorithm will work.</p></div><p>Sometimes, you might encounter a <strong>merge confilct</strong>: a section of a file where both branches have conflicting changes that cannot be automatically resolved. Here, you have to manually resolve the conflicts.</p><div class="notes"><p>which can take the form of:
|
- you intentionally select what becomes part of the record.</p></div></div><div class="step step-level-1" step="8" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="12800" data-y="0" data-z="0"><h1 id="typical-solo-local-workflow">Typical solo local workflow</h1><ol><li><strong>You initalise a directory on your computer with git</strong>.</li><li><strong>You make changes on the directory</strong>.</li><li><strong>You stage your changes and commit them</strong>.</li><li>Repeat steps <strong>2</strong> and <strong>3</strong>.</li></ol><p><strong>Use case</strong>: tracking changes on a local, private folder, like bookkeeping.</p></div><div class="step step-level-1" step="9" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="14400" data-y="0" data-z="0"><h1 id="typical-solo-remote-workflow">Typical solo remote workflow</h1><ol><li>You clone a repository from a remote host to your local computer.</li><li>You make your changes to the repository.</li><li>You stage and commit your changes.</li><li><strong>You push (upload) your commit up to the remote</strong>.</li><li>Repeat steps <strong>2</strong>, <strong>3</strong> and <strong>4</strong></li></ol><p><strong>Use case</strong>: tracking and backing up a private folder, such as passwords.</p></div><div class="step step-level-1" step="10" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="16000" data-y="0" data-z="0"><h1 id="typical-collaborative-remote-workflow">Typical collaborative remote workflow</h1><ol><li>You clone a repository from a remote host to your local computer.</li><li>You make your changes to the repository.</li><li>You stage and commit your changes.</li><li>You push (upload) your commit up to the remote.</li><li><strong>You pull (download) other people's commits from the remote</strong>.</li><li>Repeat steps <strong>5</strong>, <strong>2</strong>, <strong>3</strong> and <strong>4</strong></li></ol><p><strong>Use case</strong>: tracking and collaborating on a repository with others such as a website project with multiple developers.</p></div><div class="step step-level-1" step="11" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="17600" data-y="0" data-z="0"><h1 id="core-concept-branching">Core concept: Branching</h1><div class="row"><div><p>In git, a <strong>branch</strong> is a named series of commits.</p><div class="notes"><p>In the previous example, there is only one branch, named "main" by default.</p></div><p>When you want to "take a detour" from the main course of a repository, you can create a separate branch.</p><div class="notes"><p>Now, parrallel timelines of the same repository exist next to each other.</p></div><p>Example <strong>use cases</strong> of branching:</p><ul><li>Experiment with a new feature affecting many files</li><li>Proposing an improvement to your collaborators</li><li>Have multiple versions of a website online</li><li>Making existing software compatible somewhere else</li></ul><div class="notes"><p>There is a lot of discourse around when to branch and how often. It varies from person to person and group to group.</p><p>From the perspective of git, since branching doesn't add any technical overload on a project, it is encouraged to branch more and branch often. From a logical perspective, every branch creates a parrallel timeline, and this might be a lot to keep track of mentally.</p><p>Branching allows for and encourages collaboration and is at the core of the free and open source software movement.</p></div></div><img src="assets/images/branching.png" width="500px"></img></div></div><div class="step step-level-1" step="12" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="19200" data-y="0" data-z="0"><h1 id="core-concept-merging">Core concept: Merging</h1><div class="row"><div><p>In git, <strong>merging</strong> is when you consolidate commits from a separate branch into your own.</p><div class="notes"><p>There are various merging techniques, and most of the time, the automated algorithm will work.</p></div><p>Sometimes, you might encounter a <strong>merge confilct</strong>: a section of a file where both branches have conflicting changes that cannot be automatically resolved. Here, you have to manually resolve the conflicts.</p><div class="notes"><p>which can take the form of:
|
||||||
- accepting a change from one branch and rejecting the other
|
- accepting a change from one branch and rejecting the other
|
||||||
- accepting and keeping both changes
|
- accepting and keeping both changes
|
||||||
- re-editing the files to incorporate both changes</p></div><p>After merging two branches, a <strong>merge commit</strong> is created. This is an exceptional commit that has two parent commits instead of one.</p></div><img src="assets/images/merge.png" width="400px"></img></div></div><div class="step step-level-1" step="14" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="22400" data-y="0" data-z="0"><h1 id="complex-collaborative-remote-workflow">Complex collaborative remote workflow</h1><ol><li>You clone a repository from a remote host to your local computer.</li><li><strong>You create a new branch "my-feature" for your changes</strong>.</li><li>You make your changes to the repository.</li><li>You stage and commit your changes.</li><li>You push your commit (and new branch) up to the remote.</li><li>You pull other people's commits on this branch from the remote.</li><li>Repeat steps <strong>6</strong>, <strong>3</strong>, <strong>4</strong> and <strong>5</strong></li><li><strong>You switch back to "main" and merge "my-feature" into it</strong>.</li><li><strong>You push your new merge commit up to the "main" branch</strong>.</li></ol><p><strong>Use case</strong>: you are designing a website for a client and want to show 3 different versions of it with different background colours.</p><p><strong>Use case</strong>: tracking and collaborating on a repository with others such as a website project, where two online versions of the website exist, a "safe" one that is available to the public, and an "experimental" one that is reserved for trying new features together.</p></div><div class="step step-level-1" step="15" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="24000" data-y="0" data-z="0"><img src="assets/images/braids.png" width="100%"></img></div><div class="step step-level-1" step="16" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="25600" data-y="0" data-z="0"><h1 id="recap">Recap</h1><ul><li><strong>repository</strong>: a directory initialised with git</li><li><strong>commit</strong>: a checkpoint in the repository timeline(s)</li><li><strong>checkout</strong>: to visit the repository at a specific commit in its history.</li><li><strong>working tree</strong>: your files as they are right now in the repository</li><li><strong>staging area</strong>: a place to add changes to</li><li><strong>remote</strong>: a copy of the repository on a different host</li><li><strong>clone</strong>: to download an identical copy of a repository</li><li><strong>push</strong>: to upload local commits to a remote repository</li><li><strong>pull</strong>: to re-download commits from the remote repository</li><li><strong>branch</strong>: a named series of commits, a detour, a parallel timeline</li><li><strong>merge</strong>: a consolidation of commits from another branch</li></ul></div><div class="step step-level-1" step="17" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="27200" data-y="0" data-z="0"><h1 id="install-git">Install Git</h1><p>Check first:</p><pre class="highlight code bash">git<span class="w"> </span>--version</pre><p>If missing:</p><ul><li>macOS: <a href="https://www.mikegopsill.com/posts/install-xcode-command-line-tools/">Xcode Command Line Tools</a></li><li>Windows: <a href="https://git-scm.com/install/windows">Git for Windows</a></li><li>Linux: package manager (apt/dnf/pacman)</li></ul><p>Minimum requirement: you can run git in a terminal.</p></div><div class="step step-level-1" step="18" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="28800" data-y="0" data-z="0"><h1 id="commands-the-essentials">Commands: the essentials</h1><ul><li><tt>git init</tt> (initalise a repo)</li><li><tt>git status</tt> (what's happening?)</li><li><tt>git add</tt> (add changes to the commit)</li><li><tt>git rm</tt> (remove a tracked file)</li><li><tt>git commit</tt> (store changes in the repo)</li><li><tt>git log</tt> (see the timeline)</li><li><tt>git checkout</tt> (visit the timeline at a specific checkpoint)</li><li><tt>git clone</tt> (an existing repo)</li><li><tt>git push</tt> (your commits to a remote server)</li><li><tt>git pull</tt> (sync with a repo online and merge)</li><li><tt>git branch</tt> (take a detour)</li><li><tt>git merge</tt> (merge branches)</li></ul></div><div class="step step-level-1" step="19" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="30400" data-y="0" data-z="0"><h1 id="command-git-init">Command: git init</h1><p>Create a repository in the current folder.
|
- re-editing the files to incorporate both changes</p></div><p>After merging two branches, a <strong>merge commit</strong> is created. This is an exceptional commit that has two parent commits instead of one.</p></div><img src="assets/images/merge.png" width="400px"></img></div></div><div class="step step-level-1" step="14" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="22400" data-y="0" data-z="0"><h1 id="complex-collaborative-remote-workflow">Complex collaborative remote workflow</h1><ol><li>You clone a repository from a remote host to your local computer.</li><li><strong>You create a new branch "my-feature" for your changes</strong>.</li><li>You make your changes to the repository.</li><li>You stage and commit your changes.</li><li>You push your commit (and new branch) up to the remote.</li><li>You pull other people's commits on this branch from the remote.</li><li>Repeat steps <strong>6</strong>, <strong>3</strong>, <strong>4</strong> and <strong>5</strong></li><li><strong>You switch back to "main" and merge "my-feature" into it</strong>.</li><li><strong>You push your new merge commit up to the "main" branch</strong>.</li></ol><p><strong>Use case</strong>: you are designing a website for a client and want to show 3 different versions of it with different background colours.</p><p><strong>Use case</strong>: tracking and collaborating on a repository with others such as a website project, where two online versions of the website exist, a "safe" one that is available to the public, and an "experimental" one that is reserved for trying new features together.</p></div><div class="step step-level-1" step="15" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="24000" data-y="0" data-z="0"><img src="assets/images/braids.png" width="100%"></img></div><div class="step step-level-1" step="16" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="25600" data-y="0" data-z="0"><h1 id="recap">Recap</h1><ul><li><strong>repository</strong>: a directory initialised with git</li><li><strong>commit</strong>: a checkpoint in the repository timeline(s)</li><li><strong>checkout</strong>: to visit the repository at a specific commit in its history.</li><li><strong>working tree</strong>: your files as they are right now in the repository</li><li><strong>staging area</strong>: a place to add changes to</li><li><strong>remote</strong>: a copy of the repository on a different host</li><li><strong>clone</strong>: to download an identical copy of a repository</li><li><strong>push</strong>: to upload local commits to a remote repository</li><li><strong>pull</strong>: to re-download commits from the remote repository</li><li><strong>branch</strong>: a named series of commits, a detour, a parallel timeline</li><li><strong>merge</strong>: a consolidation of commits from another branch</li></ul></div><div class="step step-level-1" step="17" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="27200" data-y="0" data-z="0"><h1 id="install-git">Install Git</h1><p>Check first:</p><pre class="highlight code bash">git<span class="w"> </span>--version</pre><p>If missing:</p><ul><li>macOS: <a href="https://www.mikegopsill.com/posts/install-xcode-command-line-tools/">Xcode Command Line Tools</a></li><li>Windows: <a href="https://git-scm.com/install/windows">Git for Windows</a></li><li>Linux: package manager (apt/dnf/pacman)</li></ul><p>Minimum requirement: you can run git in a terminal.</p></div><div class="step step-level-1" step="18" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="28800" data-y="0" data-z="0"><h1 id="commands-the-essentials">Commands: the essentials</h1><ul><li><tt>git init</tt> (initalise a repo)</li><li><tt>git status</tt> (what's happening?)</li><li><tt>git add</tt> (add changes to the commit)</li><li><tt>git rm</tt> (remove a tracked file)</li><li><tt>git commit</tt> (store changes in the repo)</li><li><tt>git log</tt> (see the timeline)</li><li><tt>git checkout</tt> (visit the timeline at a specific checkpoint)</li><li><tt>git clone</tt> (an existing repo)</li><li><tt>git push</tt> (your commits to a remote server)</li><li><tt>git pull</tt> (sync with a repo online and merge)</li><li><tt>git branch</tt> (take a detour)</li><li><tt>git merge</tt> (merge branches)</li></ul></div><div class="step step-level-1" step="19" data-rotate-x="0" data-rotate-y="0" data-rotate-z="0" data-scale="1" data-x="30400" data-y="0" data-z="0"><h1 id="command-git-init">Command: git init</h1><p>Create a repository in the current folder.
|
||||||
|
|
|
||||||
22
slides.rst
22
slides.rst
|
|
@ -35,21 +35,21 @@ Planning (90 min)
|
||||||
5. Core commands (15 min)
|
5. Core commands (15 min)
|
||||||
6. Exercise: accounts + clone/push permissions (10 min)
|
6. Exercise: accounts + clone/push permissions (10 min)
|
||||||
7. Exercise: branch a page, publish live, iterate (20 min)
|
7. Exercise: branch a page, publish live, iterate (20 min)
|
||||||
8. Wrap-up: good practices + next steps (5 min)
|
8. Wrap-up & next steps? (5 min)
|
||||||
|
|
||||||
|
..
|
||||||
|
----
|
||||||
|
|
||||||
----
|
Workshop outcome
|
||||||
|
================
|
||||||
|
|
||||||
Workshop outcome
|
Each participant will:
|
||||||
================
|
|
||||||
|
|
||||||
Each participant will:
|
- have basic knowledge of git
|
||||||
|
- clone a repository
|
||||||
- have basic knowledge of git
|
- create a branch
|
||||||
- clone a repository
|
- commit changes
|
||||||
- create a branch
|
- push branch to our platform
|
||||||
- commit changes
|
|
||||||
- push branch to our platform
|
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue