Skip to content

Commit

Permalink
fix broken links
Browse files Browse the repository at this point in the history
  • Loading branch information
lwasser committed Feb 12, 2025
1 parent 2accf98 commit 15b8db1
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 40 deletions.
23 changes: 11 additions & 12 deletions contribute-open-source/edit-commit-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ og:image: /images/github/steps-to-contribute.png
og:image:alt: An image that shows the steps for contributing to open source on GitHub.
---

(pyos-edit-commit-files)=

# Your First Edits to a File in Your Fork: Edit & Commit

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.
Now that you've [identified and comment on an issue](identify-github-issue), [forked the repository](fork-repo) and received approval to work on an issue, it's time to make your changes.

> **💡 Reminder:** Your fix should be **small and text-based**, like updating documentation or fixing a typo.
:::{admonition} What you'll learn
:class: tip
You’ll edit a file directly in your **fork** using GitHub’s interface and commit the changes using only the native GitHub interface.
You’ll edit a file directly in your **fork** using GitHub’s interface and commit the changes using only the native GitHub interface.

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).

Expand All @@ -44,15 +46,14 @@ GitHub lets you edit files right in your browser. Here’s how:
:::{figure} /images/github/edit-commit-file.gif
:alt: "GIF showing how to edit and commit a file on GitHub."

Editing a file directly in the GitHub interface is a straight forward process.
Editing a file directly in the GitHub interface is a straight forward process.
:::

> **⚡ 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.

## Ways to edit a file: GitHub vs. GitHub Codespaces

GitHub now offers **two ways** to edit files directly in the interface or using the [cloud-based GitHub Codespaces](about-codespace). If you’re making a small change, use GitHub’s interface. If you need to edit multiple files, try Codespaces.
GitHub now offers **two ways** to edit files directly in the interface or using the [cloud-based GitHub Codespaces](about-codespace). If you’re making a small change, use GitHub’s interface. If you need to edit multiple files, try Codespaces.

| | Option | When to Use | Pros | Limitations |
|-|---------|------------|------|-------------|
Expand All @@ -63,10 +64,10 @@ GitHub now offers **two ways** to edit files directly in the interface or using
## What is a commit?

A commit is like taking a snapshot of your changes so you can always "undo" the changes if needed. You can think of a **commit** as a save (or restore) point in git's history. Each commit captures changes you make to one or more files in the repository at a specific time; each commit includes a note explaining what you did.
A commit is like taking a snapshot of your changes so you can always "undo" the changes if needed. You can think of a **commit** as a save (or restore) point in git's history. Each commit captures changes you make to one or more files in the repository at a specific time; each commit includes a note explaining what you did.

:::{tip}
A **commit** is a feature of [git version control](what-is-git), the version control system that GitHub runs in the background.
A **commit** is a feature of [git version control](what-is-git), the version control system that GitHub runs in the background.

:::

Expand All @@ -75,16 +76,15 @@ A **commit** is a feature of [git version control](what-is-git), the version con
:::{figure} /images/github/git-commits-files.png
: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.

Each commit represents **a set of changes** at a specific time.
Each commit represents **a set of changes** at a specific time.
:::

> **🛠 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.

:::{figure} /images/github/git-what-are-commits.png
: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.”

You can always **undo or revert** changes using Git.
You can always **undo or revert** changes using Git.
:::

:::{admonition} What's next?
Expand All @@ -94,9 +94,8 @@ You can always **undo or revert** changes using Git.

*****

[Learn how to create a pull request →](pull-request)
[Learn how to create a pull request →](pyos-pull-request)
:::


:::{todo}

Expand Down
2 changes: 1 addition & 1 deletion contribute-open-source/fork-repo.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,5 @@ Graphi: Screenshot of GitHub’s "Sync Fork" button
:class: important

Now that you’ve forked a repository, the next step is to **edit a file and commit your changes**.
[Learn how to edit and commit files →](edit-commit-files)
[Learn how to edit and commit files →](pyos-edit-commit-files)
:::
2 changes: 1 addition & 1 deletion contribute-open-source/get-to-know-repo.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ The above steps will help you determine whether a project is **welcoming, respon

## Next steps

Once you have explored and gotten to know the repository and decided that it's a good project to contribute to, it's time to [find an issue to work](identify-issue). You will learn more about that next.
Once you have explored and gotten to know the repository and decided that it's a good project to contribute to, it's time to [find an issue to work](identify-github-issue). You will learn more about that next.
2 changes: 1 addition & 1 deletion contribute-open-source/github-codespaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ kernelspec:

# Code spaces and contributing to open source

[In the edit commit files lesson](edit-commit-files), you learned how to directly change a file on GitHub in the browser. You didn't need a special development environment to make that change in this lesson.
[In the edit commit files lesson](pyos-edit-commit-files), you learned how to directly change a file on GitHub in the browser. You didn't need a special development environment to make that change in this lesson.

However, in some cases, developers have set up a codespace for you to use on GitHub. A codespace is a cloud-based development environment that has been set up for you (or that you can create yourself) with all of the tool and dependencies that you need to work on a project.

Expand Down
4 changes: 2 additions & 2 deletions contribute-open-source/identify-issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,5 @@ Focus on making small, meaningful contributions. Most first contributions are sm
If the maintainers invite you to submit a pull request, it's time to:

- [Fork the repository](fork-repository) if you haven't already.
- [Make your changes on a new branch in your fork.](edit-commit-files)
- [Submit a pull request](pull-request) with your updates.
- [Make your changes on a new branch in your fork.](pyos-edit-commit-files)
- [Submit a pull request](pyos-pull-request) with your updates.
14 changes: 5 additions & 9 deletions contribute-open-source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ GitHub is a **social coding platform** that allows individuals and teams to mana
## GitHub and open source

**Open source software (OSS)** is code that is publicly accessible—anyone can view, modify, and distribute it. GitHub provides the tools needed for open source projects to store code publically, manage contributions, track and address issues, and collaborate efficiently.
**Open source software (OSS)** is code that is publicly accessible—anyone can view, modify, and distribute it. GitHub provides the tools needed for open source projects to store code publically, manage contributions, track and address issues, and collaborate efficiently.

Specifically, in the Python language, the software is often [associated with packaging](https://www.pyopensci.org/python-package-guide/tutorials/intro.html), where you package up code and make it easier for a user to install on their computer. Reusable sofware allow developers and scientists to share common workflows rather than needing to recreate the code needed for each workflow themselves from scratch.
Specifically, in the Python language, the software is often [associated with packaging](https://www.pyopensci.org/python-package-guide/tutorials/intro.html), where you package up code and make it easier for a user to install on their computer. Reusable sofware allow developers and scientists to share common workflows rather than needing to recreate the code needed for each workflow themselves from scratch.

### Why open source communities use GitHub

Expand Down Expand Up @@ -97,8 +97,6 @@ GitHub is widely used in **open source** and **team-based projects** where multi
> **<i class="fa-solid fa-users" style="color: #81c0aa;"></i> Social cue:**
> Working on GitHub is more than writing code—it’s about **communication, teamwork, and reviewing each other's work**.


## Summary

| | **Feature** | **Solo Use** | **Collaborative Use** |
Expand All @@ -111,16 +109,15 @@ GitHub is widely used in **open source** and **team-based projects** where multi
:::{admonition} What's next?
:class: seealso
Now that you understand GitHub's role in **open source** and **collaboration**,
you're ready to dive into **contributing to a project!**
you're ready to dive into **contributing to a project!**

*****

<i class="fa-brands fa-github-alt"></i> [Get started with activities to guide you through your first contribution →](your-first-contribution)
<i class="fa-brands fa-github-alt"></i> [Learn how to identify an issue →](identify-issue)
<i class="fa-brands fa-github-alt"></i> [Get started with activities to guide you through your first contribution →](pyos-first-contribution)
<i class="fa-brands fa-github-alt"></i> [Learn how to identify an issue →](identify-github-issue)
<i class="fa-brands fa-github-alt"></i> [Learn how to fork a repository →](fork-repository)
:::


:::{todo}
resources
<https://www.youtube.com/watch?v=eWxxfttcMts>
Expand Down Expand Up @@ -160,7 +157,6 @@ Clone a GitHub Repo <clone-repo>
:maxdepth: 2
:hidden:


What is Git/GitHub <what-is-git-github>
GitHub Social platform <github-social-platform>
Use GitHub codespaces <github-codespaces>
Expand Down
4 changes: 2 additions & 2 deletions contribute-open-source/pull-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ myst_html_meta:
"keywords": "GitHub, OpenSource"
"property=og:locale": "en_US"
---

(pyos-pull-request)=
# About Pull Requests

In the last lesson, you learned how to [make and commit a change to a document in a GitHub repository](edit-commit-files).
In the last lesson, you learned how to [make and commit a change to a document in a GitHub repository](pyos-edit-commit-files).
In this lesson, you will learn how to submit a pull request after making changes to a file in a GitHub repository.

A GitHub pull request (**PR**):
Expand Down
10 changes: 5 additions & 5 deletions contribute-open-source/your-first-contribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ myst_html_meta:
"og:image": /images/github/steps-to-contribute.png
"og:image:alt": An image that shows the steps for contributing to open source on GitHub.
---

# Mastering GitHub Collaboration Skills
(pyos-first-contribution)=
# Your First Open Source Contribution

Contributing to open source in a public space like GitHub can feel intimidating. You may not know the project maintainers, feel unsure about your GitHub skills, or wonder where to begin.

Expand Down Expand Up @@ -82,7 +82,7 @@ Open a new browser tab after reading through the [get-to-know a repo lesson](get

### Step 2: Find an issue to work on

Next, [identify an issue or bug that you want to work on](identify-issue). Sometimes, there is already an open issue in a repo that you want to address. So, reading through existing open issues before opening a new one is always a good idea. If you already have a fix in mind that doesn't exist in the existing issue list, you will [create a new issue](create-issue) in the repo.
Next, [identify an issue or bug that you want to work on](identify-github-issue). Sometimes, there is already an open issue in a repo that you want to address. So, reading through existing open issues before opening a new one is always a good idea. If you already have a fix in mind that doesn't exist in the existing issue list, you will [create a new issue](create-issue) in the repo.

:::{button-link} identify-issue.html
:color: primary
Expand Down Expand Up @@ -140,7 +140,7 @@ Once you've successfully forked the repo, it's time to edit the file you want to
:::{admonition} Activity: Make a change to a file and commit it to your fork

1. Navigate to your fork on GitHub.com
2. In the GitHub interface, click on the file that you proposed to modify or fix [in the identify issue lesson](identify-issue)
2. In the GitHub interface, click on the file that you proposed to modify or fix [in the identify issue lesson](identify-github-issue)
3. Click on the edit <kbd><i class="fa-solid fa-pencil"></i></kbd> button in the GitHub interface.
4. Make the edits to the file that you proposed in your issue.
5. Hit the <kbd>commit</kbd> button to save your edits
Expand All @@ -159,7 +159,7 @@ Commit message examples:

### Step 5: Submit a pull request

Once your edits are [committed to git version control](edit-commit-files), open a <kbd>Pull Request</kbd> to the parent repository.
Once your edits are [committed to git version control](pyos-edit-commit-files), open a <kbd>Pull Request</kbd> to the parent repository.

:::{button-link} pull-request.html
:color: primary
Expand Down
8 changes: 4 additions & 4 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

Learn how to navigate the technical and social elements of making a contribution to open source code on GitHub.

* [Your First Contribution](your-first-contribution)
* [Your First Contribution](pyos-first-contribution)
* [Get to know a new repo](new-repo)
* [Find an issue to work on](identify-issue)
* [Find an issue to work on](identify-github-issue)
* [Fork a repo](fork-repository)
* [Edit & commit files](edit-commit-files)
* [Submit a pull request](pull-request)
* [Edit & commit files](pyos-edit-commit-files)
* [Submit a pull request](pyos-pull-request)

:::
::::
Expand Down
4 changes: 1 addition & 3 deletions write-better-code/optimize-code/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ kernelspec:

More here


:::{toctree}
:hidden:
:maxdepth: 2
:glob:

*
:::


:::

0 comments on commit 15b8db1

Please sign in to comment.