Skip to content

Commit 91488f4

Browse files
committed
The second part of the summer internship interview
1 parent 96e50e4 commit 91488f4

File tree

7 files changed

+138
-302
lines changed

7 files changed

+138
-302
lines changed

README.md

Lines changed: 39 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,53 @@
1-
# git-workshop
2-
#### Welcome to the Git Workshop hosted by SCE
1+
# Interview Part 2: GitHub Edition
32

4-
Today we are going to learn the following:
5-
- What is Git/GitHub
6-
- Basic Version Control
7-
- Pulling and Pushing Branches
8-
- Switching/Creating Branches
3+
This project is a collaborative collection of simple HTML recipes. You can use AI tools to help you!
94

105
---
11-
### First Steps:
12-
1. Install Git
13-
- If you dont have Git installed, you will need to install it onto your operating system
146

15-
| Operating System | Relevant Links |
16-
| --- | --- |
17-
| Windows | [Link Here](https://git-scm.com/download/win) |
18-
| Mac | [Link Here](https://git-scm.com/download/mac) |
19-
| Linux | [Link Here](https://git-scm.com/download/linux) |
7+
## 🚀 How to Clone and Setup
208

21-
<details>
22-
<summary> Additional Notes for Mac</summary>
23-
- There are several ways to install git onto your system. of the options, we reccomend homebrew which you can install with the following command:
24-
25-
```
26-
$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)
27-
```
28-
29-
</details>
30-
31-
---
32-
### Cloning the repo:
33-
2. Next lets try cloning the repo.
34-
- For this we will be using <code style="color:#A9FFF7">git clone</code>.
35-
- Make sure you are in the folder you want to put the repo into
36-
37-
```
9+
1. Clone the repo:
10+
```bash
3811
git clone https://github.com/SCE-Development/git-workshop.git
12+
cd git-workshop
13+
```
14+
2. Once you're in the project directory, run the below command. It will
15+
output a file path, which you can copy and paste into your browser URL input
16+
to open the project.
17+
```
18+
echo "$(pwd)/index.html"
3919
```
4020

41-
---
42-
43-
### Creating your branch:
44-
3. Now we are going to create a branch specifically for you to work on. There are two types of branches that we can use
45-
46-
| Local | Remote |
47-
| --- | --- |
48-
| Stored on your computer | Stored on Github |
49-
50-
- Today we will be creating a local branch and publishing it onto the workshop repository
51-
52-
We can create our branch a couple different ways:
21+
If on windows:
22+
```
23+
echo %cd%\index.html
24+
```
5325

54-
<details>
55-
<summary> Using Git Checkout</summary>
56-
git checkout -b [INSERT YOUR BRANCH NAME]
57-
</details>
26+
## Contributing
27+
Make **3 pull requests** as described below. Branch names should follow a convention of:
5828

59-
<details>
60-
<summary> Using Git Branch</summary>
61-
git branch [INSERT YOUR BRANCH NAME]
29+
`NAME/DATE_short_description`, i.e. `andy/20270601_add_pancake_recipe`
6230

63-
git checkout [INSERT YOUR BRANCH NAME]
64-
</details>
31+
### 1. Add Your Own Recipe
32+
- Create a new `.html` file with your recipe.
33+
- Link to it from `index.html`.
34+
- In your pull request description, **include a screenshot** of your recipe page.
6535

66-
---
36+
### 2. Modify an Existing Recipe
37+
- On a separate branch, open a PR that **changes one ingredient or step** in an existing recipe.
6738

68-
### Pushing your changes:
69-
4. We want to make sure we are currently on our new branch.
70-
- Make sure to use <code style="color:#A9FFF7">git branch</code> to view the branch you are on.
71-
- You can switch to your branch by using "<code style="color:#A9FFF7">git checkout [INSERT YOUR BRANCH NAME]</code>"
39+
### 3. Add a "Food Critic" Section
40+
- On a third branch that branches **from the same branch as your recipe PR**, add a `<div>` below your recipe labeled **"Food Critic Review"** or similar.
41+
- This PR should **depend on the recipe PR** and point to your original recipe branch
42+
- In this PR description, add a note like `merge #NUMBER first!`
7243

73-
Steps:
74-
1. Change line 144 in your index.html to your name.
75-
2. In your terminal, you want to commit the changes you have made so type the following:
76-
```
77-
git commit -m "[INSERT YOUR MESSAGE HERE]" index.html
78-
```
79-
3. Once this is complete, you've officially made your first commit.
80-
4. Then type <code style="color:#A9FFF7">git push</code> into your terminal
81-
---
82-
### Check for everyone else's branches
83-
5. Remember <code style="color:#A9FFF7">git fetch</code>? Now we should be able to see everyone else's branches on the remote repository when we type <code style="color:#A9FFF7">git fetch</code>.
84-
85-
86-
---
87-
## <code style="color:#6D98BA"> Congrats, you know the basics of committing and pushing to Git! </code>
44+
## A completed 3 pull requests should look like:
45+
```
46+
main
47+
48+
├───▶ YOUR_NAME/DATE_add-my-recipe (PR #1: Your new recipe)
49+
│ │
50+
│ └──▶ YOUR_NAME/DATE_add-food-critic (PR #3: Review section)
51+
52+
└───▶ YOUR_NAME/DATE_update-existing (PR #2: Edits existing recipe)
53+
```

index.html

Lines changed: 22 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -1,151 +1,24 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8">
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<title>SCE Git Workshop</title>
7-
<link rel="icon" type="image/x-icon" href="./favicon.ico">
8-
<link rel="stylesheet" href="styles.css">
9-
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inter">
10-
<script src="script.js"></script>
11-
</head>
12-
<body>
13-
<!-- Entire page-->
14-
<div class="page">
15-
<!-- Content (no footer) -->
16-
<div class="content">
17-
<h1>SCE Git Workshop</h1>
18-
<!-- Tab links -->
19-
<div class="tab">
20-
<button class="tablinks" onclick="openTab(event, 'WhyGit')" id="defaultTab">Why Git? Show my change here</button>
21-
<button class="tablinks" onclick="openTab(event, 'GitCommands')">Git Cheat Sheet</button>
22-
</div>
23-
<!-- Tab content -->
24-
<div id="WhyGit" class="tabcontent">
25-
<h3>Why Git?</h3>
26-
<ol>
27-
<li>Version Tracking: 1.69</li>
28-
<ul>
29-
<li>AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH</li>
30-
<li>You can easily compare versions to understand what was added, modified, or deleted.</li>
31-
</ul>
32-
<li>Collaboration:</li>
33-
<ul>
34-
<li>Git facilitates collaboration among multiple developers on the same project.</li>
35-
<li>Multiple people can work on different branches and merge their changes seamlessly.</li>
36-
</ul>
37-
<li>Branching and Merging:</li>
38-
<ul>
39-
<li>Git makes it easy to create branches for different features or bug fixes.</li>
40-
<li>You can merge branches back into the main codebase when they are ready.</li>
41-
</ul>
42-
<li>Undo and Rollback:</li>
43-
<ul>
44-
<li>Git allows you to undo changes or roll back to a previous state of your code.</li>
45-
<li>This can be invaluable for fixing mistakes or dealing with unexpected issues.</li>
46-
</ul>
47-
<li>Security and Data Integrity:</li>
48-
<ul>
49-
<li>Git ensures data integrity through cryptographic checksums (SHA-1 hashes) for every file and commit.</li>
50-
<li>It's difficult for unauthorized users to alter the history or codebase.</li>
51-
</ul>
52-
<li>History and Documentation:</li>
53-
<ul>
54-
<li>Git's commit history provides a detailed record of all changes, including who made them and why.</li>
55-
<li>This serves as valuable documentation for project evolution.</li>
56-
</ul>
57-
<li>And more!</li>
58-
</ol>
59-
<p>TL;DR: Git version control offers a robust and flexible way to manage code, collaborate with others, and maintain the integrity and history of your projects, making it an essential tool for developers and teams of all sizes.</p>
60-
</div>
61-
62-
<div id="GitCommands" class="tabcontent">
63-
<h3>Git Cheat Sheet</h3>
64-
<code>git init</code>
65-
<ul>
66-
<li>Initializes a new Git repository in the current directory.</li>
67-
</ul>
68-
<code>git clone [repository URL]</code>
69-
<ul>
70-
<li>Creates a copy (clone) of a remote Git repository to your local machine.</li>
71-
</ul>
72-
<code>git add [file(s)]</code>
73-
<ul>
74-
<li>Stages changes for commit. You can specify specific files or use "." to add all changes.</li>
75-
</ul>
76-
<code>git commit -m "[commit message]"</code>
77-
<ul>
78-
<li>Records staged changes in a commit with a descriptive message.</li>
79-
</ul>
80-
<code>git status</code>
81-
<ul>
82-
<li>Shows the status of your working directory, including untracked, modified, and staged files.</li>
83-
</ul>
84-
<code>git log</code>
85-
<ul>
86-
<li>Displays a history of commits in the repository, including commit hashes, authors, dates, and messages.</li>
87-
</ul>
88-
<code>git branch</code>
89-
<ul>
90-
<li>Lists all branches in the repository and indicates the currently active branch with an asterisk (*).</li>
91-
</ul>
92-
<code>git checkout [branch or commit]</code>
93-
<ul>
94-
<li>Switches to a different branch or a specific commit. Helpful for navigating your project's history.</li>
95-
</ul>
96-
<code>git pull</code>
97-
<ul>
98-
<li>Fetches changes from the remote repository and merges them into the current branch (usually the default branch).</li>
99-
</ul>
100-
<code>git push</code>
101-
<ul>
102-
<li>Pushes your local commits to the remote repository, keeping it up to date.</li>
103-
</ul>
104-
<code>git merge [branch]</code>
105-
<ul>
106-
<li>Merges changes from a specified branch into the current branch.</li>
107-
</ul>
108-
<code>git remote -v</code>
109-
<ul>
110-
<li>Lists the remote repositories linked to your local repository, showing their URLs.</li>
111-
</ul>
112-
<code>git fetch</code>
113-
<ul>
114-
<li>Fetches changes from the remote repository but doesn't automatically merge them into the current branch.</li>
115-
</ul>
116-
<code>git reset [file]</code>
117-
<ul>
118-
<li>Unstages changes from the staging area, or use with "--hard" to reset to a previous commit (cautiondata loss).</li>
119-
</ul>
120-
<code>git rm [file]</code>
121-
<ul>
122-
<li>Removes a file from the working directory and stages the removal for the next commit.</li>
123-
</ul>
124-
<code>git diff</code>
125-
<ul>
126-
<li>Shows the differences between the working directory and the last committed version.</li>
127-
</ul>
128-
<code>git tag [tag name]</code>
129-
<ul>
130-
<li>Creates a tag (a named pointer to a specific commit) for easy reference to important commits.</li>
131-
</ul>
132-
<code>git stash</code>
133-
<ul>
134-
<li>Temporarily saves changes that aren't ready for commit, allowing you to switch branches or perform other tasks.</li>
135-
</ul>
136-
<code>git push origin --tags</code>
137-
<ul>
138-
<li>Pushes tags to the remote repository, sharing important points in the project's history.</li>
139-
</ul>
140-
</div>
141-
</div>
142-
<!-- Footer -->
143-
<div class="footer">
144-
<p>Brought to you by SCE Dev-Team - Cloned by brendan-ly</p>
145-
</div>
146-
<script>
147-
document.getElementById("defaultTab").click();
148-
</script>
149-
</div>
150-
</body>
151-
</html>
3+
4+
<head>
5+
<meta charset="UTF-8" />
6+
<title>COOL RECIPES</title>
7+
</head>
8+
9+
<body>
10+
<h1>Recipes that have a special place in my heart</h1>
11+
<ul>
12+
<li>
13+
<a href="recipe/egg.html">Egg city, I am the mayor</a>
14+
</li>
15+
<li>
16+
<a href="recipe/greatestsandwichofalltime.html">Peanut Butter Banana Sandwich</a>
17+
</li>
18+
<li>
19+
<a href="recipe/pasta.html">One-Pot Pasta</a>
20+
</li>
21+
</ul>
22+
</body>
23+
24+
</html>

recipe/egg.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<head>
5+
<title>Microwave Scrambled Eggs</title>
6+
</head>
7+
8+
<body>
9+
<a href="../index.html">home</a>
10+
<h1>Microwave Scrambled Eggs</h1>
11+
<h2>Ingredients:</h2>
12+
<ul>
13+
<li>2 eggs</li>
14+
<li>Splash of milk</li>
15+
<li>Salt & pepper</li>
16+
</ul>
17+
<h2>Instructions:</h2>
18+
<ol>
19+
<li>Crack egg into a microwave-safe mug.</li>
20+
<li>Add a splash of milk, salt, and pepper.</li>
21+
<li>Whisk with a fork.</li>
22+
<li>Microwave for ~1 minute, stir halfway. Done!</li>
23+
</ol>
24+
</body>
25+
26+
</html>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<head>
5+
<title>Peanut Butter Banana Sandwich</title>
6+
</head>
7+
8+
<body>
9+
<a href="../index.html">home</a>
10+
<h1>Peanut Butter Banana Sandwich</h1>
11+
<h2>Ingredients:</h2>
12+
<ul>
13+
<li>2 slices of bread</li>
14+
<li>Peanut butter</li>
15+
<li>1 banana</li>
16+
</ul>
17+
<h2>Instructions:</h2>
18+
<ol>
19+
<li>Spread peanut butter on one or both slices.</li>
20+
<li>Slice banana and layer it in.</li>
21+
<li>Close, slice, and yum!</li>
22+
</ol>
23+
</body>
24+
25+
</html>

recipe/pasta.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<head>
5+
<title>Butter Pasta</title>
6+
</head>
7+
8+
<body>
9+
<a href="../index.html">home</a>
10+
<h1>One-Pot Butter Pasta</h1>
11+
<h2>Ingredients:</h2>
12+
<ul>
13+
<li>1 serving spaghetti</li>
14+
<li>1 tbsp butter</li>
15+
<li>1 big cheese</li>
16+
<li>Salt</li>
17+
</ul>
18+
<h2>Instructions:</h2>
19+
<ol>
20+
<li>Boil pasta in salted water, drain.</li>
21+
<li>In the same pot, melt butter and saute briefly.</li>
22+
<li>Toss pasta back in, mix well, season, cheesemax and serve.</li>
23+
</ol>
24+
</body>
25+
26+
</html>

0 commit comments

Comments
 (0)