Skip to content

Commit 1639b07

Browse files
committed
fix: cleanup and add social context
1 parent 046480e commit 1639b07

File tree

8 files changed

+196
-95
lines changed

8 files changed

+196
-95
lines changed

github-git/clone-repo.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ On the main **GitHub.com** page of the repository, you can click on the green bu
4343

4444
`https://github.com/your-username/repo-name`
4545

46-
46+
::::{todo}
4747
:::{figure} /images/github/image-coming-soon.png
4848
:alt: alt text here
4949

5050
You can make a local copy of your forked repository on your computer with the git clone command.
5151
:::
52-
52+
::::
5353

5454
:::{tip}
5555
You can copy the URL directly from your web browser, or in some cases, you might already know the URL. However, in many cases, you will come across a new **GitHub.com** repository on your own and will need to follow these instructions to copy the URL for future use.

github-git/edit-commit-files.md

Lines changed: 52 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -18,83 +18,97 @@ og:image: /images/github/steps-to-contribute.png
1818
og:image:alt: An image that shows the steps for contributing to open source on GitHub.
1919
---
2020

21-
# Your first edits to a file in your fork
21+
# Your First Edits to a File in Your Fork: Edit & Commit
2222

23-
:::{todo}
24-
Github has changed things a bit. If you edit the file in place, it automatically directs you to a pr workflow in the repo that you are in.
25-
26-
So I think we want to break this down into two things
23+
Now that you've [identified and comment on an issue](identify-issue), [forked the repository](fork-repo) and received approval to work on an issue, it's time to make your changes.
2724

28-
1. The drive-by pull request
25+
> **💡 Reminder:** Your fix should be **small and text-based**, like updating documentation or fixing a typo.
2926
30-
* Click on the edit button in the repo that you want to make changes.
31-
* If you don't have permission, it will automatically ask you about making a branch, which will be from your fork.
27+
:::{admonition} What you'll learn
28+
:class: tip
29+
You’ll edit a file directly in your **fork** using GitHub’s interface and commit the changes using only the native GitHub interface.
3230

33-
2. The pr from your fork. If the fork already exists, then you can still edit the file.
31+
NOTE: If you want to work on the files locally on your laptop, you will need to [clone or make a copy of your repo locally](clone-repo).
3432

3533
:::
3634

37-
In the previous lesson, [you identified something that you wanted to fix in our example GitHub repository](identify-issue). Ideally, the fix that you identified is small, text-based, and can be made by modifying a single file.
35+
## How to edit a file in your fork
3836

39-
After you [forked the repository that you want to contribute to](fork-repo) and received approval from a maintainer to work on the issue, it's time to start making the changes you suggested.
37+
GitHub lets you edit files right in your browser. Here’s how:
4038

41-
:::{admonition} What you'll learn here
42-
:class: tip
43-
In this lesson, you will edit a file in the demo pyOpenSci repository using the GitHub interface in your [forked repo](fork-repo). You will then commit your changes.
44-
:::
45-
46-
Here, you will make the changes that you proposed to work on using only the native GitHub interface.
47-
To do this, you do not need to [clone or make a copy of your repo locally](clone-repo).
39+
1. Navigate to **your fork** of the repository.
40+
2. Find the file you want to edit.
41+
3. Click the <kbd><i class="fa-solid fa-pencil" style="color: #81c0aa;"></i> Edit</kbd> button.
42+
4. Make your changes and **commit** them.
4843

4944
:::{figure} /images/github/edit-commit-file.gif
45+
:alt: "GIF showing how to edit and commit a file on GitHub."
5046

47+
Editing a file directly in the GitHub interface is a straight forward process.
5148
:::
5249

53-
## About editing files on GitHub
54-
55-
Editing a file on GitHub allows you to focus on the contributing workflow without needing to learn or install git, create a local development environment, or use the command line.
56-
57-
Following this process, you can edit as many files as you wish. However, on GitHub, you must edit and commit changes to them individually.
50+
> **⚡ Quick tip:** You can edit as many files as you want, but GitHub only lets you commit them **one at a time** in the browser.
5851
59-
### Editing files on GitHub vs GitHub Codespaces vs Locally
6052

61-
In the above image, you edit the file online at GitHub.com. To do this, you navigate to the page that you want to edit and click on the <kbd><i class="fa-solid fa-pencil"></i></kbd> edit button. This approach is a great way to start contributing as you don't have to
53+
## Editing files directly on GitHub vs. GitHub Codespaces
6254

63-
1. use the command line to edit the file
64-
2. know how to use .git
55+
GitHub now offers **two ways** to edit files directly in the interface or using the cloud based GitHub Codespaces:
6556

66-
However, the one small downside of this approach is that you can only edit and commit one file at a time.
57+
| Option | When to Use | Pros | Limitations |
58+
|---------|------------|------|-------------|
59+
| **GitHub Interface** <i class="fa-solid fa-pencil" style="color: #81c0aa;"></i> | Quick edits (typos, small fixes) | No setup needed, edit in browser | Can only commit one file at a time |
60+
| **GitHub Codespaces** <i class="fa-solid fa-laptop-code" style="color: #81c0aa;"></i> | Editing multiple files | Full VS Code environment in browser | Requires configuration but once configured, you can reuse it |
6761

68-
An alternative way to edit multiple files on GitHub is to use GitHub Codespaces.
62+
> **💡 Need to edit multiple files using a coding editor like VsCode or Jupyter?** Learn more about using [GitHub Codespaces](github-codespaces).
6963
70-
[GitHub codespaces](github-codespaces) provide online GitHub development environments that allow you to edit multiple files and commit them together using an IDE (interactive development environment) such as VsCode.
71-
72-
Sometimes, maintainers will set up a codespace for you to use. Or, you can also set one up yourself in your fork. GitHub codespaces also come with GitHub setup, which means that you can commit files to your fork within VsCODE vs needing to know how to use the command line.
7364

7465
## What is a commit?
7566

76-
Here are 3 points to remember when you think about commits:
67+
You can think of a **commit** as a save (or restore) point in git version control's history. Each commit captures changes that you make to one or more files in the repository at a specific point in time; each commit includes a note explaining what you did.
68+
69+
:::{tip}
70+
A **commit** is a feature of [git version control](what-is-git), the version control system that GitHub runs in the background.
7771

78-
1. A **commit** is a feature of [git version control](what-is-git) that is similar to saving your changes with a note explaining what you did.
72+
:::
7973

80-
2. Each commit that you make represents a set of changes to one or more files in your repository at a specific time.
74+
### How commits work
8175

8276
:::{figure} /images/github/git-commits-files.png
8377
:alt: A visual example demonstrating how Git tracks changes to a document through commits. The image shows an “Original File” with its initial text, followed by two commits. The first commit adds a new paragraph of text, with the changes highlighted in green and the commit message, “Fix: added a new paragraph to clarify text.” The second commit fixes typos in the text, with the edits highlighted in green and the commit message, “Fix: copy edits.” At the bottom, a comparison shows the document after each commit, illustrating how the file evolves with changes.
8478

79+
Each commit represents **a set of changes** at a specific time.
8580
:::
8681

87-
3. Because you are using git, you can always revert or undo a set of changes in your commit history. While undoing things in git takes a bit more knowledge, knowing it can be done can give you the confidence to make changes without worrying about breaking things!
82+
> **🛠 Do you need to undo changes that you made?** Git lets you revert to an earlier commit, so you don’t have to worry about breaking anything.
83+
8884

8985
:::{figure} /images/github/git-what-are-commits.png
9086
:alt: A diagram explaining Git commits and their role in version control. The top section shows a timeline of circular commits, each paired with a file icon to represent file changes, with the text: “Each commit represents one or more file changes made at a specific point in time.” The middle section highlights the “Latest Commit” on the timeline, showing it as the current state of the repository. The bottom section demonstrates the concept of reverting, with an arrow pointing from a later commit back to a previous one, illustrating that Git allows reverting or going back to earlier commits. The text reads: “You can also always revert or return to a previous commit. This is what makes Git powerful.”
9187

88+
You can always **undo or revert** changes using Git.
9289
:::
9390

94-
## Up next - create a pull request
91+
## Up next: Make a pull request
92+
93+
Once you've committed your changes, you can open a **pull request (PR)** to suggest your edits to the main project.
94+
95+
[Learn how to create a pull request →](pull-request)
9596

96-
Once you have made the changes to the files that you wish to change in your branch, you are ready to open a [pull request](pull-request). You will learn how to do that next.
9797

9898
:::{todo}
99+
99100
It might be cool to show first contributions like my first on to nbconvert could be interesting? Other people might have examples too from the community that we could share with some stories about it??
101+
102+
103+
Github has changed things a bit. If you edit the file in place, it automatically directs you to a pr workflow in the repo that you are in.
104+
105+
So I think we want to break this down into two things
106+
107+
1. The drive-by pull request
108+
109+
* Click on the edit button in the repo that you want to make changes.
110+
* If you don't have permission, it will automatically ask you about making a branch, which will be from your fork.
111+
112+
2. The pr from your fork. If the fork already exists, then you can still edit the file.
113+
100114
:::

0 commit comments

Comments
 (0)