Skip to content

Commit 6cc3183

Browse files
authored
Merge pull request #16 from UMLCloudComputing/feat--Update-Tutorials-section
Feat update tutorials section
2 parents 0cb26c7 + 7598c00 commit 6cc3183

24 files changed

+1155
-20
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div align="center">
22
<a href="https://cloudcomputingclub.cs.uml.edu/">
3-
<img src="./club-logo.png" alt="Logo" width="50%" height="50%">
3+
<img src="./club-logo.png" alt="Logo" width="50%" height="50%"/>
44
</a>
55
<hr>
66
<h1>The UML Cloud Computing Club Website</h1>

docs/Getting Started and FAQ.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Feel free to reach out to our club leaders for more information. We look forward
1919
#### Q: How do I join the club?
2020
**A**: The best way to join is to attend our regular meetings. You can also join our [Discord server](https://discord.gg/WC2NdqYtDt) for updates and discussions.
2121

22-
### Meetings
22+
### 📡 Meetings
2323

2424
#### Q: When and where are the meetings held?
2525
**A**: The meeting schedule is outlined in the README. The location will be announced prior to each meeting.
@@ -30,23 +30,23 @@ Feel free to reach out to our club leaders for more information. We look forward
3030
#### Q: What if I miss a meeting?
3131
**A**: Don't worry! Meeting materials and summaries will be uploaded to the respective week's folder in our GitHub repository.
3232

33-
### Projects
33+
### 👩‍💻 Projects
3434

3535
#### Q: Do I need prior experience to contribute to the project?
3636
**A**: No, you don't need prior experience. We aim to make the project inclusive for members at all skill levels.
3737

3838
#### Q: How can I contribute to the project?
3939
**A**: Contributions can be made through our project repository on GitHub. More details can be found in the "Project Repository" section of this README.
4040

41-
### Technologies
41+
### 💡 Technologies
4242

4343
#### Q: Do I need to know all the technologies listed to participate?
4444
**A**: No, you don't need to be proficient in all the technologies. The club serves as a learning platform, and we'll cover various technologies throughout the semester.
4545

4646
#### Q: What if I'm interested in a technology not listed?
4747
**A**: We're open to exploring new technologies! Feel free to bring it up during meetings or on our Discord server.
4848

49-
### Contact
49+
### 🙌 Contact
5050

5151
#### Q: How can I contact the club leaders?
5252
**A**: You can reach out to us via our [Discord server](https://discord.gg/WC2NdqYtDt) or by sending an email to [cloudcomputingclub@uml.edu](mailto:cloudcomputingclub@uml.edu).
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"label": "Advanced",
3+
"position": 2,
4+
"link": {
5+
"type": "generated-index"
6+
}
7+
}
8+
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
---
2+
sidebar_position: 6
3+
---
4+
5+
# Branch
6+
7+
### Using Git branches
8+
9+
A [branch](./Index.md/#branch) is a seperate version of the main repository.<br/>
10+
Branches are particuarly useful when a developer wants to update parts of a large project.
11+
12+
Git branches allow development on a new features and designs independent from other work on the main branch.<br/>
13+
When the work is complete on a branch, it can be [merged](./Index.md/#merge) back into the main branch/project.<br/>
14+
With branches, it's also possible to work on different parts of a project simultaneously without any part impacting another.
15+
16+
### Creating a new Branch
17+
18+
Let's create a new [branch](./Index.md/#branch) to work on a feature without modifying the main project's working code:
19+
20+
``` bash
21+
[user@localhost] $ git branch hello-world-pictures
22+
```
23+
The command `git branch hello-world-pictures` will create a new [branch](./Index.md/#branch) called "hello-world-pictures".<br />
24+
Let's confirm that the branch was created:
25+
``` bash
26+
[user@localhost] $ git branch
27+
hello-world-pictures
28+
* master
29+
```
30+
> Important: Whenever creating new branches, the branch from which the *new* branch is sourced from is the branch which was mounted when the git branch command was called. In scenario above, the command was called from within the `master` branch. Hence, all the initial files and changes are sourced from the `master` branch for the `hello-world-pictures` branch.
31+
32+
A new branch called "hello-world-pictures" has been created, however the `*` symbol indicates that we are currently still on the `master` [branch](./Index.md/#branch).
33+
> When viewing the output of `git branch`, the `*` symbol indicates the current branch.
34+
35+
![Git-Staging-Diagram-3](../../../../static/img/git-tutorial/git-workflow-3.png)
36+
37+
In order to leave the `master` [branch](./Index.md/#branch) and change to the "hello-world-pictures" [branch](./Index.md/#branch) we have to use the [`checkout`](./Index.md/#checkout) command.
38+
39+
``` bash
40+
[user@localhost] $ git checkout hello-world-pictures
41+
Switched to branch 'hello-world-pictures'
42+
```
43+
> Note: Adding the `-b` option on `git checkout` will create a new branch and move to it, if it does not exist.
44+
45+
Now let's make some edits now that we're in the correct branch.
46+
Let's add an [image](https://software.3metas.com/wp-content/uploads/2017/06/git.png)(needs to be downloaded) to our html page:
47+
48+
First let's obtain the image:
49+
> In order to download the image via the CLI use one of the following commands from the same working directory as `index.html`:
50+
> - Windows:
51+
> ``` powershell
52+
> wget https://software.3metas.com/wp-content/uploads/2017/06/git.png > git.png
53+
> ```
54+
> - Linux & Mac:
55+
> ``` bash
56+
> curl https://software.3metas.com/wp-content/uploads/2017/06/git.png > git.png
57+
> ```
58+
59+
60+
Then let's update our html code:
61+
``` html
62+
<!DOCTYPE html>
63+
<html>
64+
<head>
65+
<title>Hello World!</title>
66+
<link rel="stylesheet" href="styles.css">
67+
</head>
68+
69+
<body>
70+
<h1>Hello world!</h1>
71+
<div>
72+
<img src="git.png" alt="Git Logo" style="width:100%;max-width:960px">
73+
</div>
74+
<p>This is the first file in my new Git Repo.</p>
75+
<p>A new line in our file!</p>
76+
</body>
77+
</html>
78+
```
79+
80+
Let's [save and exit](./New%20Files.md/#basic-editing-on-vim) and check the status of the current [branch](./Index.md/#branch)
81+
82+
``` bash
83+
[user@localhost] $ git status
84+
On branch hello-world-pictures
85+
Changes not staged for commit:
86+
(use "git add <file>..." to update what will be committed)
87+
(use "git restore <file>..." to discard changes in working directory)
88+
modified: index.html
89+
90+
Untracked files:
91+
(use "git add <file>..." to include in what will be committed)
92+
git.png
93+
94+
no changes added to commit (use "git add" and/or "git commit -a")
95+
```
96+
97+
The output indicates that there are tracked changes to `index.html`, however the file is not [staged](./Index.md/#stage) for a [commit](./Index.md/#commit). Moreover, there is also the image `git.png` that is currently untracked.
98+
99+
So let's add all the changes to the [staging area](./Index.md/#staging-area):
100+
``` bash
101+
[user@localhost] $ git add --all
102+
```
103+
104+
Now let's check the status of the [branch](./Index.md/#branch):
105+
``` bash
106+
[user@localhost] $ git status
107+
On branch hello-world-pictures
108+
Changes to be committed:
109+
(use "git restore --staged <file>..." to unstage)
110+
new file: git.png
111+
modified: index.html
112+
```
113+
114+
Now all the changes are staged and can be committed.
115+
116+
Since we're satifisied with our changes, let's [commit](./Index.md/#commit) them to our [branch](./Index.md/#branch):
117+
``` bash
118+
[user@localhost] $ git commit -m "feat: Added image to hello world"
119+
[hello-world-pictures 83d7fb0] feat: Added image to hello world
120+
2 files changed, 3 insertions(+)
121+
create mode 100644 git.png
122+
```
123+
124+
### Switching between Branches
125+
126+
Now let's see the power of branches! <br />
127+
Let's check content within our branch:
128+
129+
``` bash
130+
[user@localhost] $ ls
131+
git.png index.html README.md styles.css
132+
```
133+
Notice how the `hello-world-pictures` [branch](./Index.md/#branch) has the image `git.png`. As per the edits we've made, `index.html` should also have modified code to include the image.
134+
135+
Now's let's change to the `master` branch using the `checkout` command:
136+
``` bash
137+
[user@localhost] $ git checkout master
138+
Switched to branch 'master'
139+
```
140+
141+
Finally let's check the content of this [branch](./Index.md/#branch):
142+
``` bash
143+
[user@localhost] $ ls
144+
index.html README.md styles.css
145+
```
146+
`git.png` is gone! Moreover, if we open and check `index.html` we can see that it no longer has the edits we made recently!
147+
148+
Branches enable you to work on parts of a project independently.
149+
150+
---
151+
All rights belong to the author and/or owner of the [image](https://software.3metas.com/wp-content/uploads/2017/06/git.png).
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
sidebar_position: 11
3+
---
4+
5+
# Citations
6+
7+
This entire tutorial is HEAVILY inspiried from [W3 School's](https://www.w3schools.com/git/default.asp?remote=github) tutorial. Major credit goes to their tutorial on Git.
8+
9+
APA 7:
10+
>[Git Logo Image](https://software.3metas.com/wp-content/uploads/2017/06/git.png): (2024). 3metas.com. https://software.3metas.com/wp-content/uploads/2017/06/git.png
11+
12+
> [Hello World Image](https://www.elegantthemes.com/blog/wp-content/uploads/2020/08/hello-world.png): https://www.elegantthemes.com/blog/wp-content/uploads/2020/08/hello-world.png
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
sidebar_position: 5
3+
---
4+
5+
# Commits
6+
7+
![Git-Staging-Diagram-2](../../../../static/img/git-tutorial/git-workflow-2.png)
8+
9+
Commits keep track of progress and changes as we work. Git treats each [`commit`](./Index.md/#commit) as a "save point". It's a point in the project which can be reverted to if a bug is found, or you want to make a change.
10+
11+
Whenever performing a [`commit`](./Index.md/#commit), **always** include a commit **message**.
12+
It's always best practice to do so and improves understanding of your code for others and subsequently maintainability of your project.
13+
14+
``` bash
15+
[user@localhost] $ git commit -m "init commit"
16+
[master (root-commit) d3d38f6] init commit
17+
3 files changed, 23 insertions(+)
18+
create mode 100644 README.md
19+
create mode 100644 index.html
20+
create mode 100644 styles.css
21+
```
22+
23+
`git commit` performs a commit and the `-m `*`"message"`* adds a message to the commit. <br/>
24+
Now the staging area has been committed to the repository with the message "init commit".
25+
26+
There are general [guidelines](https://www.conventionalcommits.org/en/v1.0.0/) for writing git commit message which are common in industry. It's **highly valuable** to be aware of these practices to write effective and informative commit messages.
27+
28+
### Git Commits without staging
29+
30+
Sometimes when small changes are made, the staging area can seem like a hassle. Hence, it's convienient to commit directly and avoid the staging area. <br/>
31+
By using the `-a` option on `git commit`, it's possible to stage every changed and already tracked file.
32+
33+
To show this let's update `index.html` slightly:
34+
``` html
35+
<!DOCTYPE html>
36+
<html>
37+
<head>
38+
<title>Hello World!</title>
39+
<link rel="stylesheet" href="styles.css">
40+
</head>
41+
42+
<body>
43+
<h1>Hello world!</h1>
44+
<p>This is the first file in my new Git Repo.</p>
45+
<p>A new line within our page!</p>
46+
</body>
47+
</html>
48+
```
49+
>Recall, to open a file to edit in your working directory with [Vim](./Index.md/#vim), enter the command `vim `*`filename`* and enter insert mode (`I` key on the keyboard). To save and exit enter normal mode (`esc` key) and enter the command `:wq` (write and quit).
50+
51+
Now let's check the status of our [repo](./Index.md/#repository-repo), however with the `--short` option to get a more compact response:
52+
``` bash
53+
[user@localhost] $ git status --short
54+
M index.html
55+
```
56+
> Note: The `--short` option on `git status` is also synonymous with `-s`. Hence, either `git status -s` or `git status --short` can be used to perform the same action.
57+
58+
Here's some valuable [information](./Index.md/#git-status-short) about short git status flags.
59+
60+
Now let's commit directly:
61+
``` bash
62+
[user@localhost] $ git commit -a -m "feat: Added a new line in index.html"
63+
feat: Added a new line in index.html
64+
1 file changed, 1 insertion(+)
65+
```
66+
> Notice how the commit message follows the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) structure.
67+
68+
<blockquote className="warning">Warning: It's typically not best practice to skip the staging area since it's possible to accidentally commit unwanted changes. Commit carefully. </blockquote>
69+
70+
In order to view the commit history of your repository, use the `log` command:
71+
``` bash
72+
[user@localhost] $ git log
73+
commit c4c4abe5c0156a5626cdafc1e5722d5b2b23e833 (HEAD -> master)
74+
Author: example user <user@example.com>
75+
Date: Sun Jul 21 14:12:35 2024 -0400
76+
77+
feat: Added a new line in index.html
78+
79+
commit d3d38f65bb0bde98b47a6747d8d02b2e53bd0bcb
80+
Author: example user <user@example.com>
81+
Date: Sun Jul 21 13:46:57 2024 -0400
82+
83+
init commit
84+
```
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
sidebar_position: 9
3+
---
4+
5+
# Excersises
6+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
5+
# Getting Started
6+
7+
## Creating a Git folder
8+
9+
Creating a new folder for a project:
10+
``` bash
11+
[user@localhost] $ mkdir newProject
12+
[user@localhost] $ cd newProject
13+
```
14+
15+
[`mkdir`](./Index.md/#mkdir) makes a new directory. <br />
16+
[`cd`](./Index.md/#cd) changes the current working directory.
17+
18+
## Initialize Git
19+
Once in the correct folder, initialize git on the folder:
20+
``` bash
21+
[user@localhost] $ git init
22+
Initialized empty Git repository in /User/user/newProject/.git/
23+
```
24+
New Git repository created!
25+
26+
> Git automatically knows to watch this folder for changes within a hidden folder.

0 commit comments

Comments
 (0)