diff --git a/.DS_Store b/.DS_Store index 3d5c4e3..d3b50cf 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/presentation/.DS_Store b/presentation/.DS_Store new file mode 100644 index 0000000..423f810 Binary files /dev/null and b/presentation/.DS_Store differ diff --git a/presentation/Intro_To_Git.html b/presentation/Intro_To_Git.html new file mode 100644 index 0000000..bae6c89 --- /dev/null +++ b/presentation/Intro_To_Git.html @@ -0,0 +1,1323 @@ + +
+ + + + + + + + + + + +
$ cd your_dir
@@ -95,11 +99,7 @@ $ git init
A hidden ".git" folder has been created in your folder. This contains everything Git needs to work.
:::
-## {data-background-image=../images/ICCS_content_slide.png}
-
-
-What is a Git commit?
-
+## What is a Git commit?
- You can think of a commit as a snapshot of your work at a particular time
- You can navigate between commits easily with git
- This allows you to switch easily between different versions of your work
@@ -107,27 +107,20 @@ What is a Git commit?
and only stores the files which have been changed between the previous commit and your current one
- The commit also stores a reference to its parent commit
-## {data-background-image=../images/ICCS_content_slide.png}
+## Commiting is a three part process:
-
-Commiting is a three part process:
-
1. Modify: change the file in your working tree, ie go in and edit the file as usual
2. Stage: Tell git that you would like this file to be included in your next commit
3. Commit: Tell git to take a snapshot of the files you staged
-## {data-background-image=../images/ICCS_content_slide.png}
+## At each step in the process, the file is stored in a different area:
-
-At each step in the process, the file is stored in a different area:
-
-
+
-## {data-background-image=../images/ICCS_content_slide.png}
+## git commit
-
This means that Git has four main states that your files can be in:
-
+
- Untracked: You've created a new file and not told git to keep track of it.
- Modified: You've changed a file that git already has a record of, but have not told
git to include these changes in your next commit.
@@ -136,19 +129,12 @@ We say these files are in the working tree.
We say these files are in the staging area.
- Committed: The file is saved in it's present state in the most recent commit.
-## {data-background-image=../images/ICCS_content_slide.png}
+## Exercise 2a, create an untracked file:
-
-Exercise 2a, create an untracked file:
-
-
+
-## {data-background-image=../images/ICCS_content_slide.png}
-
-
-Exercise 2a, create an untracked file:
+## Exercise 2a, create an untracked file:
- Create a new file in your repository.
-
@@ -164,7 +150,7 @@ $ git status
-## {data-background-image=../images/ICCS_content_slide.png}
+## git status
$ git status
@@ -189,33 +175,25 @@ Highlights your working branch -> main
Proposes adding these to git with 'git add'
:::
-## {data-background-image=../images/ICCS_content_slide.png}
+## Exercise 2b, add the untracked file to the staging area:
-
-Exercise 2b, add the untracked file to the staging area:
-
-
+
-## {data-background-image=../images/ICCS_content_slide.png}
+## Exercise 2b, add the untracked file to the staging area:
-
-Exercise 2b, add the untracked file to the staging area:
Try these commands...
-
$ git add .
-
$ git status
-
-## {data-background-image=../images/ICCS_content_slide.png}
+## git add
@@ -235,34 +213,27 @@ Changes to be committed:
::: {.callout-tip title="git add"}
Moves file(s) into "Staging area" ready for commit
-
:::
-## {data-background-image=../images/ICCS_content_slide.png}
+## Exercise 2c, commiting your changes:
-
-Exercise 2c, commiting your changes:
-
-
+
-## {data-background-image=../images/ICCS_content_slide.png}
+## Exercise 2c, commiting your changes:
-
-Exercise 2c, commiting your changes:
-
- Commit your file to the local git repo
-
-
+Commit your file to the local git repo
+
$ git commit -m "Created new.txt"
-
+
'git commit' >>>> tells git you want to commit
'-m "Comment"' >>>> adds a description to the log for this commit. This is important as it tells you and others what the commit intent is.
-## {data-background-image=../images/ICCS_content_slide.png}
+## git commit
@@ -285,8 +256,7 @@ nothing to commit, working tree clean
-## {data-background-image=../images/ICCS_content_slide.png}
-
+## git log
$ git log
@@ -306,46 +276,31 @@ Displays commits in reverse chronological order.
Includes full identifier, author and date
:::
-## {data-background-image=../images/ICCS_content_slide.png}
+## What is a Git branch?
-
-What is a Git branch?
-
- A branch is a pointer to a git commit
- It says "I want to include the work of this commit and all of its parent commits."
- We can use the `checkout` command to switch between different branches and commits
-
+
-## {data-background-image=../images/ICCS_content_slide.png}
+## Exercise 3, creating a git branch:
-
-Exercise 3, creating a git branch, checking it out and commiting
-
-
+{width=40%}
-## {data-background-image=../images/ICCS_content_slide.png}
+## Exercise 3, creating a git branch and checking it out
-
-Exercise 3, creating a git branch and checking it out
-
- Create a new branch using: `git branch my-shiny-new-branch`
- Checkout the branch using: `git checkout my-shiny-new-branch`
- Make a change in your new branch by editing new.txt and committing the changes.
- Note: you can combine the first two steps into one using `git checkout -b my-shiny-new-branch`
-## {data-background-image=../images/ICCS_content_slide.png}
-
-
-Exercise 4, switching between branches
-
-
+## Exercise 4, switching between branches
+
+{width=35%}
-## {data-background-image=../images/ICCS_content_slide.png}
+## Exercise 4, switching between branches
-
-Exercise 4, switching between branches
-
- return to the main branch using `git checkout main`
- open the new.txt file, what's inside?
- make a new file, `new_2.txt`
@@ -354,28 +309,26 @@ Exercise 4, switching between branches
- Note: you can use `git checkout -` as a shortcut for returning to the previous branch you checked out.
-## {data-background-image=../images/ICCS_content_slide.png}
+## Ways of working with a remote repository
-
-Ways of working with a remote repository
-
-
A remote repository is one stored in the cloud. We will be using GitHub to do this today. \
There are two different ways to copy a remote repository so that you can work on it locally:
-
+
+
- clone: This makes a copy locally which is closely linked to the remote version.
Your local branches can be synced to branches in the original.
+
+
- fork: This makes another separate version of the repo remotely that you own. Once you
have forked a repo remotely, you can then clone it to your local machine.
+
+
Branches created locally can't be synced to branches in the original repo,
they are synced to your forked repo instead. You can still open pull requests to the
original if you would like to make a contribution to it.
-## {data-background-image=../images/ICCS_content_slide.png}
+## To clone or to fork?
-
-To clone or to fork?
-
Use a clone when:
- You are collaborating directly and actively with the owner of the repo (e.g. it is your research team, or you)
@@ -386,11 +339,8 @@ OR all of the following is true:
- You want easy access to the latest changes made by others to the central repository
- You want the main branch in the repo to be updated and edited by others working on the project
-## {data-background-image=../images/ICCS_content_slide.png}
+## To clone or to fork?
-
-To clone or to fork?
-
Use a fork when:
- The owner of the repo is not someone you are actively collaborating with
@@ -401,24 +351,11 @@ Use a fork when:
- Or you do not have permission to push branches directly to the original repo
-## {data-background-image=../images/ICCS_content_slide.png}
-
-
-Working with remote repositories
-
-
-
-## {data-background-image=../images/ICCS_content_slide.png}
-
-
-Exercise 5, forking a repo from GitHub
-
+## Working with remote repositories
-## {data-background-image=../images/ICCS_content_slide.png}
+{width=50%}
-
-Collaborative git with GitHub
-
+## Collaborative git with GitHub
::: {.callout-warning}
You must have already created a github account and connected your local git repo to it before you can do these exercises
@@ -428,29 +365,27 @@ Navigate to https://github.com/Cambridge-ICCS and find the 'git-intro-iccs-summe
We will fork this repo, clone the fork to our local computers, make edits and then try merging these back into the original repo.
-## {data-background-image=../images/ICCS_content_slide.png}
+## Exercise 5:
-
-Exercise 5:
- From Github, Cambridge-ICCS/git-intro-iccs-summer-school-2024
-
+
:::: {.columns}
::: {.column width="40%"}
-
+
:::
::: {.column width="60%"}
-
+
:::
::::
-## {data-background-image=../images/ICCS_content_slide.png}
-
+## Cloning from GitHub
+
Your forked repo only exists in Github. To work on it locally it needs to be copied to your local computer.
-
+
@@ -472,24 +407,21 @@ Do not clone into an existing local git repo.
- For any commits after that on the branch you can use `git push` on it's own when you are on the branch you want to push.
:::
-## {data-background-image=../images/ICCS_content_slide.png}
-
+## Pull requests
+
The final step is to put in a pull request (PR) to the original repo that we forked from.
+
A pull request is how we signal to the repo owner that we want to merge in our changes.
-
-
Depending on the code and the repo, you may not be able to merge directly.
-
Reviews by one or more developers who may suggest/require edits to you code
-
Pass testing
-
+- Reviews by one or more developers who may suggest/require edits to you code
+- Pass testing
+
+
+## Learning Outcomes
-## {data-background-image=../images/ICCS_content_slide.png}
-
-Learning Outcomes
-
::: {.incremental}
- Be familiar with the building blocks of git: repositories, commits and branches
- Get started with using git locally on your own projects
@@ -497,10 +429,9 @@ Learning Outcomes
- Gain an appreciation for how useful git can be
:::
-## {data-background-image=../images/ICCS_content_slide.png}
-
+## Final thoughts?
Anything you'd like to revisit or build on from today?
-
+
Please come and visit us at a code clinic. \
Book a slot in our "ICCS Summer School Code Clinic spreadsheet",
diff --git a/presentation/custom_theme.scss b/presentation/custom_theme.scss
new file mode 100644
index 0000000..8b6fbe8
--- /dev/null
+++ b/presentation/custom_theme.scss
@@ -0,0 +1,47 @@
+
+/*-- scss:rules --*/
+
+// title and headings
+
+
+
+#title-slide {
+ text-align: center;
+
+ .title {
+ color: #fffae6;
+ font-weight: 350;
+ //line-height: 0;
+ }
+
+ .subtitle {
+ color: #fffae6;
+ font-style: italic;
+ }
+
+ .author, .quarto-title-author-name, .quarto-title-authors {
+ color: #fffae6;
+ font-size: 1.2em;
+ }
+
+}
+
+#title-slide .slide-logo{
+ top: 200px;
+ background: #ffffff;
+}
+
+/*-- vertically center columns (or any container) --*/
+.v-center-container {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 90%;
+}
+
+/*-- standard offset for text on content slides --*/
+.reveal .slides > section:not(#title-slide) {
+ padding-top: 50px; /* Adjust the value as needed */
+}
+
+
diff --git a/image_src/Fork vs Clone.drawio b/presentation/image_src/Fork vs Clone.drawio
similarity index 100%
rename from image_src/Fork vs Clone.drawio
rename to presentation/image_src/Fork vs Clone.drawio
diff --git a/image_src/Staging area diagram.drawio b/presentation/image_src/Staging area diagram.drawio
similarity index 100%
rename from image_src/Staging area diagram.drawio
rename to presentation/image_src/Staging area diagram.drawio
diff --git a/image_src/commit_illustration_src.drawio b/presentation/image_src/commit_illustration_src.drawio
similarity index 100%
rename from image_src/commit_illustration_src.drawio
rename to presentation/image_src/commit_illustration_src.drawio
diff --git a/images/.DS_Store b/presentation/images/.DS_Store
similarity index 100%
rename from images/.DS_Store
rename to presentation/images/.DS_Store
diff --git a/images/Fork menu.png b/presentation/images/Fork menu.png
similarity index 100%
rename from images/Fork menu.png
rename to presentation/images/Fork menu.png
diff --git a/images/Github fork.png b/presentation/images/Github fork.png
similarity index 100%
rename from images/Github fork.png
rename to presentation/images/Github fork.png
diff --git a/images/ICCS_content_slide.png b/presentation/images/ICCS_content_slide.png
similarity index 100%
rename from images/ICCS_content_slide.png
rename to presentation/images/ICCS_content_slide.png
diff --git a/images/ICCS_title_slide.png b/presentation/images/ICCS_title_slide.png
similarity index 100%
rename from images/ICCS_title_slide.png
rename to presentation/images/ICCS_title_slide.png
diff --git a/images/add_to_staging_area.png b/presentation/images/add_to_staging_area.png
similarity index 100%
rename from images/add_to_staging_area.png
rename to presentation/images/add_to_staging_area.png
diff --git a/images/commit_to_repository.png b/presentation/images/commit_to_repository.png
similarity index 100%
rename from images/commit_to_repository.png
rename to presentation/images/commit_to_repository.png
diff --git a/images/create_untracked_file.png b/presentation/images/create_untracked_file.png
similarity index 100%
rename from images/create_untracked_file.png
rename to presentation/images/create_untracked_file.png
diff --git a/images/creating_branch_and_checking_out.png b/presentation/images/creating_branch_and_checking_out.png
similarity index 100%
rename from images/creating_branch_and_checking_out.png
rename to presentation/images/creating_branch_and_checking_out.png
diff --git a/images/fork_vs_clone.png b/presentation/images/fork_vs_clone.png
similarity index 100%
rename from images/fork_vs_clone.png
rename to presentation/images/fork_vs_clone.png
diff --git a/images/git.png b/presentation/images/git.png
similarity index 100%
rename from images/git.png
rename to presentation/images/git.png
diff --git a/images/git_branching_illustration.png b/presentation/images/git_branching_illustration.png
similarity index 100%
rename from images/git_branching_illustration.png
rename to presentation/images/git_branching_illustration.png
diff --git a/images/git_commit_2x.png b/presentation/images/git_commit_2x.png
similarity index 100%
rename from images/git_commit_2x.png
rename to presentation/images/git_commit_2x.png
diff --git a/images/show_different_file_states.png b/presentation/images/show_different_file_states.png
similarity index 100%
rename from images/show_different_file_states.png
rename to presentation/images/show_different_file_states.png
diff --git a/images/switching_between_branches.png b/presentation/images/switching_between_branches.png
similarity index 100%
rename from images/switching_between_branches.png
rename to presentation/images/switching_between_branches.png
diff --git a/presentation/index.html b/presentation/index.html
new file mode 100644
index 0000000..38042fc
--- /dev/null
+++ b/presentation/index.html
@@ -0,0 +1,1231 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ Introduction to git and GitHub
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
+