Your first contribution

#2 · closed · 3 comments

View on GitHub ↗

github-learning-lab[bot]

### Introduction to GitHub flow Now that you're familiar with issues, let's use this issue to track your path to your first contribution. People use different workflows to contribute to software projects, but the simplest and most effective way to contribute on GitHub is the GitHub flow. :tv: [Video: Understanding the GitHub flow](https://www.youtube.com/watch?v=PBI2Rz-ZOxU) <hr> <h3 align="center">Read below for next steps</h3>

Comments

github-learning-lab[bot]

## Step 4: Create a branch Let’s complete the first step of the GitHub flow: creating a branch <sup>[:book:](https://help.github.com/articles/github-glossary/#branch)</sup>. <details><summary>Creating a branch</summary> ## Creating a branch :tv: [Video: Branches](https://www.youtube.com/watch?v=xgQmu81G1yY) You just learned how to create a branch—the first step in the GitHub flow. Branches are an important part of the GitHub flow because they allow us to separate our work from the `master` branch. In other words, everyone's work is safe while you contribute. ### Tips for using branches A single project can have hundreds of branches, each suggesting a new change to the `master` branch. The best way to keep branches organized with a team is to keep them concise and short-lived. In other words, a single branch should represent a single new feature or bug fix. This reduces confusion among contributors when branches are only active for a few days before they’re merged <sup>[:book:](https://help.github.com/articles/github-glossary/#merge)</sup> into the `master` branch. <hr> </details> ### :keyboard: Activity: Your first branch 1. Navigate to the [Code tab](https://github.com/Edditoria/github-slideshow) 2. Click **Branch: master** in the drop-down 3. In the field, enter a name for your branch, like `my-slide` 4. Click **Create branch: <name>** or press the “Enter” key to create your branch <hr> <h3 align="center">I'll respond when I detect a new branch has been created in this repository.</h3>

github-learning-lab[bot]

## Step 5: Commit a file :tada: You created a branch! Creating a branch allows you to make modifications to your project without changing the deployed `master` branch. Now that you have a branch, it’s time to create a file and make your first commit! <details><summary>Commits 101</summary> ## Commits 101 When you’re finished creating or making changes to a file on GitHub, scroll to the bottom of the page. Then find the "Commit new file" section. In the first field, type a commit message. The commit message should briefly tell contributors about the changes you are introducing to the file. ### Rules to live by for commit messages: - Don’t end your commit message with a period. - Keep your commit messages to 50 characters or less. Add extra detail in the extended description window if necessary. This is located just below the subject line. - Use active voice. For example, "add" instead of "added" and "merge" instead of "merged". - Think of your commit as expressing intent to introduce a change. <hr> </details> ### :keyboard: Activity: Your first commit The following steps will guide you through the process of committing a change on GitHub. 1. Create a new file on this branch, in a `_posts` folder called `0000-01-02-Edditoria.md`. You can do so using [this shortcut](https://github.com/Edditoria/github-slideshow/new/my-slide?filename=_posts/0000-01-02-Edditoria.md) or manually as follows: - Return to the "Code" tab - In the branch drop-down, select "my-slide" - Click **Create new file** - In the "file name" field, type `_posts/0000-01-02-Edditoria.md`. Entering the `/` in the filename will automatically place your file in the `_posts` directory. 1. When you’re done naming the file, add the following content to your file: ```yaml --- layout: slide title: "Welcome to our second slide!" --- Your text Use the left arrow to go back! ``` 1. After adding the text, you can commit the change by entering a commit message in the text-entry field below the file edit view. For guidelines on commit messages, check out the **Commits 101** drop-down, just above these instructions 1. When you’ve entered a commit message, click **Commit new file** <hr> <h3 align="center">I'll respond when I detect a new commit on this branch.</h3>

github-learning-lab[bot]

## Step 6: Open a pull request Nice work making that commit :sparkles: Now that you’ve created a commit, it’s time to share your proposed change through a pull request! Where issues encourage discussion with other contributors and collaborators on a project, pull requests help you share your changes, receive feedback on them, and iterate on them until they’re perfect! <details><summary>What is a pull request?</summary> ## Pull requests Let’s think back to the GitHub flow again. You have created a branch, added a file, and committed the file to your branch. Now it’s time to collaborate on your file with other students taking this class. This collaboration happens in a pull request. Check out this video to learn more: :tv: [Video: Introduction to pull requests](https://youtu.be/kJr-PIfLDl4) <hr> </details> This pull request is going to keep the changes you just made on your branch and propose applying them to the `master` branch. ### :keyboard: Activity: Create a pull request 1. Open a pull request using [this shortcut](https://github.com/Edditoria/github-slideshow/compare/refs/heads/my-slide?expand=1) or manually as follows: - From the "Pull requests" tab, click **New pull request** - In the "base:" drop-down menu, make sure the "master" branch is selected - In the "compare:" drop-down menu, select "my-slide" 1. When you’ve selected your branch, enter a title for your pull request. For example `Add Edditoria's file` 1. The next field helps you provide a description of the changes you made. Feel free to add a description of what you’ve accomplished so far. As a reminder, you have: created a branch, created a file and made a commit, and opened a pull request 1. Click **Create pull request** <hr> <h3 align="center">I'll respond in your new pull request.</h3>