Skip to content

Commit 57df0a0

Browse files
committed
update making changes on github chapter
1 parent 77383f6 commit 57df0a0

27 files changed

+175
-25
lines changed

content/01-getting-started-with-git-and-github/06-pulling-from-remote.md

+68-16
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,86 @@ weight: 7
1010

1111
Now, what if you you make changes directly on the GitHub repository or using another machine ? These changes are not locally synchronized with your primary computer. This is where **pull** comes into play.
1212

13-
<br>
13+
## Make a change on GitHub
1414

15-
- Navigate to your repository in GitHub and scroll down to *README.md*. GitHub automatically uses this file as a landing page to a repository which at the moment should be a mere *git-lesson*. To edit this file click on the small pencil icon. This icon is available for any file if you click on it but specifically for `README.md` it's also available as soon as you enter your repository.
15+
### Go to GitHub repo
1616

17-
<img src="/images/work-9-gk.png" alt="title picture" width="700px">
17+
Navigate to your repository in GitHub and scroll down to *README.md*. GitHub automatically uses this file as a landing page to a repository which at the moment should be a mere *git-lesson*.
1818

19-
<br>
19+
### Open `README.md` for editing
2020

21+
To edit this file click on the small pencil icon on the top right hand corner. This icon is available for any file if you click on it but specifically for `README.md` it's also available as soon as you enter your repository.
2122

22-
- Now let's add some text, *Markdown* text (more on markdown [later](https://annakrystalli.me/open-source-workshop/practicalexercises/github/git-02-websites-with-github-pages)).
23+
<img src="/images/work-7a-gk.png" alt="title picture" width="700px">
2324

24-
<img src="/images/work-11-gk.png" alt="title picture" width="700px">
25-
<br>
2625

27-
- Let's see how our Markdown code is rendered and check for typos in the text. If we are happy we can commit the changes. Since we are working online on GitHub there is no **push**.
26+
This will open up an editable version of the `README.md` file on GitHub that we can edit in the browser.
2827

29-
<img src="/images/work-10-gk.png" alt="title picture" width="700px">
28+
<img src="/images/work-7b-gk.png" alt="title picture" width="700px">
3029

31-
<br>
30+
### Edit `README.md`
3231

33-
- Now back in GitKraken Client, we see that our remote repository is ahead of our local. We can also see that it is the local README.md file that is out of date. In order to synchronize the local with the remote repository we can use **Pull**. This will "download" any updates from the remote repository to our local one.
32+
Now let's **add some more details about the content's of our repo** to our README using *Markdown* text (more on markdown [later]({{< ref "/01-markdown-intro" >}}).
3433

35-
<img src="/images/work-12-gk.png" alt="title picture" width="700px">
34+
<img src="/images/work-7c-gk.png" alt="title picture" width="700px">
3635

37-
<br>
36+
I added the following:
3837

39-
- Let's seen what happened after pulling the remote repository.
38+
```md
39+
# git-lesson
4040

41-
<img src="/images/work-13-gk.png" alt="title picture" width="700px">
41+
This repo was created as part of the Version Control for researchers workshop
4242

43-
<br>
43+
**Location:** Online
44+
45+
```
46+
47+
When editing files on GitHub our issue, the main body of the editor contains two tabs:
48+
49+
- **<i class="fa fa-file-code" aria-hidden="true"></i> Edit:** where you make your edits.
50+
- **<i class="fa fa-eye" aria-hidden="true"></i> Preview:** (if the content is markdown) where you can preview what the content will look like when it is rendered once the commit is made.
51+
52+
Toggle the tabs below to explore this feature. Note how `#` and `***` notation is rendered in the Preview tab.
53+
54+
{{< tabs groupId="readme" >}}
55+
{{% tab name="Edit" %}}
56+
{{< figure src="/images/work-7c-gk.png" >}}
57+
{{% /tab %}}
58+
{{% tab name="Preview" %}}
59+
{{< figure src="/images/work-7d-gk.png" >}}
60+
{{% /tab %}}
61+
{{% /tabs %}}
62+
63+
### Commit changes to `README.md`
64+
65+
Once you are happy with your changes, go ahead and **commit** them by clicking the **Commit changes** button.
66+
67+
<img src="/images/work-7e-gk.png" alt="title picture" width="700px">
68+
69+
This opens up a panel that should look somewhat familiar to you by now. Go ahead and **enter an informative commit message**. Also, leave the option to **Commit directly to the `main` branch** selected and click on **Commit changes**.
70+
71+
<img src="/images/work-7f-gk.png" alt="title picture" width="700px">
72+
73+
The changes to the `README.md` file have now been committed:
74+
75+
<img src="/images/work-7g-gk.png" alt="title picture" width="700px">
76+
77+
And are also now visible on the landing page of our repository:
78+
79+
<img src="/images/work-7h-gk.png" alt="title picture" width="700px">
80+
81+
## Pull remote changes to local repository
82+
83+
Now back in GitKraken Client, we see that our remote repository is ahead of our local one.
84+
85+
<img src="/images/work-7i-gk.png" alt="title picture" width="700px">
86+
87+
In order to synchronize the local with the remote repository we can use **Pull**. This will "download" any updates from the remote repository to our local one.
88+
89+
90+
<img src="/images/work-7j-gk.png" alt="title picture" width="700px">
91+
92+
93+
Everything is now in synch again!
94+
95+

content/02-websites-with-github-pages/02-create-markdown-website.md

+107-9
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,119 @@ title: Create a Markdown Website
33
weight: 2
44
---
55

6-
## Add markdown to your Repository
6+
## Create a website landing page (`index.md`)
77

8-
1. On your computer, create a file in your repository called `index.md`. index is always the entry point to any website - the "Default" webpage.
8+
In GitKraken create a file in your repository called `index.md`.
99

10-
2. Add some content - perhaps this could be your to-do list or a "Welcome to my homepage" page if you like. Save it and commit it to your repository, then push to GitHub.
10+
> `index` files have special meaning and represent the entry point to any website - the "Default" webpage.
1111
12-
## Enable the website component
12+
To create a new file in GitKraken Client, we can **use the Command Palette**.
1313

14-
Now you need to **enable GitHub Pages** in order to see it turn into a live website.
14+
To initiate the Command Palette, hit <img src="/images/command-symbol.png" width="2px" style="align:left; display:inline; margin:0;"/> **| Ctrl + P**, type **Create File**, and hit Enter.
1515

16-
1. On your GitHub repository, go to the settings (top rightish tab with a cog icon).
16+
Then enter the file name `index.md`.
1717

18-
2. Scroll down to the `GitHub pages` section. Under `Source`, select `master branch` or `main branch` and press save.
18+
<img src="/images/web-1a-gk.png" alt="title picture" width="700px">
1919

20-
3. You can also select a theme if you like!
2120

22-
4. Once this is done, you should see a green message saying _"Your site is published at_ **some-link.github.io**_"_. Click on it - and ta-da! You have a website.
21+
## Add content to `index.md`
22+
23+
I've added some welcoming text to my landing page.
24+
25+
I also added:
26+
27+
- a **hyperlink** to the workshop materials.
28+
- an **image** which I sourced from [Unsplash](https://unsplash.com/photos/6wAGwpsXHE0) and **downloaded to the root of my repository**. I also added the attribution tag for the photographer who took the picture. This is actually in HTML but as you will see, markdown files can also render HTML content.
29+
30+
<img src="/images/web-1b-gk.png" alt="title picture" width="700px">
31+
32+
```md
33+
# My first Website
34+
35+
Welcome to my website!
36+
37+
I created this website during [this workshop](https://r-rse-git-github-zero2hero.netlify.app/)
38+
39+
![](belinda-fewings-6wAGwpsXHE0-unsplash.jpg)
40+
41+
Photo by <a href="https://unsplash.com/@bel2000a?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Belinda Fewings</a> on <a href="https://unsplash.com/photos/6wAGwpsXHE0?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
42+
43+
44+
```
45+
46+
## Commit everything and push to GitHub
47+
48+
- Save any changes you made to `index.md`
49+
- Stage `index.md` and any images you added.
50+
- Commit.
51+
- Push to GitHub.
52+
53+
<img src="/images/web-1c-gk.png" alt="title picture" width="700px">
54+
55+
## Enable the GitHub Pages
56+
57+
Now we need to **enable GitHub Pages** in order to tell GitHub to serve your repository as a website.
58+
59+
On your GitHub repository, go to the **<i class="fa fa-cog" aria-hidden="true"></i> Settings** (top right-ish tab).
60+
61+
<img src="/images/web-2a-gh.png" alt="title picture" width="700px">
62+
63+
In **Settings**, scroll down on the left navigation panel the **<i class="fa-solid fa-browser" aria-hidden="true"></i> Pages** section.
64+
65+
<img src="/images/web-2b-gh.png" alt="title picture" width="700px">
66+
67+
### Configure GitHub Pages
68+
69+
This opens up the **GitHub Pages panel** where we can configure how we want our website to be served.
70+
71+
<img src="/images/web-2c-gh.png" alt="title picture" width="700px">
72+
73+
Under the **Build and deployment** section:
74+
75+
- Leave the **Source** set tho **Deploy from a branch**.
76+
- Under **Branch** choose the **`main`** branch and **<i class="fa fa-folder" aria-hidden="true"></i>
77+
`/(root)`** of the directory as the source for your website's content.
78+
- Click **Save**.
79+
80+
Once you click on **Save**, GitHub will start building your website in the background (this might take a minute)
81+
82+
### Enable HTTPS
83+
84+
In the meantime, while our website is being built and in the interest of security, let's go ahead and **enable HTTPS** by scrolling down and ticking the **Enable HTTPS** option.
85+
86+
<img src="/images/web-2d-gh.png" alt="title picture" width="700px">
87+
88+
89+
## View your website
90+
91+
Once your page is built, the details including the URL to your site will be shown on your GitHub Pages panel (you might need to refresh the page for it to appear).
92+
93+
<img src="/images/web-2e-gh.png" alt="title picture" width="700px">
94+
95+
Click on **Visit site** to launch your webpage!
96+
97+
<img src="/images/web-2f-gh.png" alt="title picture" width="700px">
98+
99+
100+
### Add website URL to repository metadata
101+
102+
It's nice for visitors to your repository to be able to easily find their way to your website.
103+
104+
A simple way to do this is to add the URL to your website to your repository metadata.
105+
106+
To do so, first **copy the URL from your browser** (or your GitHub Pages panel).
107+
108+
Next, head back to the root of your repository on GitHub.
109+
110+
On the right hand **About** panel, click on the **<i class="fa fa-cog" aria-hidden="true"></i>** button.
111+
112+
<img src="/images/web-2g-gh.png" alt="title picture" width="700px">
113+
114+
Paste the URL to your site in the **Website** field and **Save changes**
115+
116+
<img src="/images/web-2h-gh.png" alt="title picture" width="700px">
117+
118+
Your now **easily get to your site through the About** metadata panel!
119+
120+
<img src="/images/web-2i-gh.png" alt="title picture" width="700px">
23121

static/images/web-1a-gk.png

950 KB
Loading

static/images/web-1b-gk.png

902 KB
Loading

static/images/web-1c-gk.png

961 KB
Loading

static/images/web-2a-gh.png

856 KB
Loading

static/images/web-2b-gh.png

860 KB
Loading

static/images/web-2c-gh.png

945 KB
Loading

static/images/web-2d-gh.png

921 KB
Loading

static/images/web-2e-gh.png

929 KB
Loading

static/images/web-2f-gh.png

4.99 MB
Loading

static/images/web-2g-gh.png

887 KB
Loading

static/images/web-2h-gh.png

943 KB
Loading

static/images/web-2i-gh.png

896 KB
Loading

static/images/work-7-gk.png

-106 KB
Binary file not shown.

static/images/work-7a-gk.png

793 KB
Loading

static/images/work-7b-gk.png

758 KB
Loading

static/images/work-7c-gk.png

863 KB
Loading

static/images/work-7d-gk.png

858 KB
Loading

static/images/work-7e-gk.png

681 KB
Loading

static/images/work-7f-gk.png

958 KB
Loading

static/images/work-7g-gk.png

731 KB
Loading

static/images/work-7h-gk.png

980 KB
Loading

static/images/work-7i-gk.png

791 KB
Loading

static/images/work-7j-gk.png

840 KB
Loading

static/images/work-8-gk.png

-106 KB
Binary file not shown.

static/images/work-9-gk.png

-157 KB
Binary file not shown.

0 commit comments

Comments
 (0)