Skip to content

Commit 94fa07a

Browse files
committed
Fix the fork and first open source page
1 parent 41ddd18 commit 94fa07a

File tree

3 files changed

+308
-85
lines changed

3 files changed

+308
-85
lines changed

docs/GitHub/GitHub-basics/first-opensource-code.md

Lines changed: 232 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3,137 +3,315 @@ id: first-opensource-code
33
title: Let's Do First Opensource Project
44
sidebar_label: First Opensource Project
55
sidebar_position: 5
6-
tags: [html, web-development, elements, tags]
7-
description: In this tutorial, you will learn about HTML elements and tags. HTML elements are the building blocks of HTML pages, and tags are used to define the structure of the content.
8-
keywords: [html, web development, elements, tags, html elements, html tags, html tutorial, html basics, web design, web pages, websites, html structure, html elements tutorial, html tags tutorial, html in 2024]
6+
tags: [git, github, open-source, contribution, pull-request, fork]
7+
description: In this tutorial, you will learn how to make your first open source contribution on GitHub without using the command line. Learn to fork, edit, commit, and create pull requests directly through the GitHub web interface.
8+
keywords: [git, github, open source, first contribution, pull request, fork repository, github tutorial, web-based editing, opensource contribution, beginner guide, github workflow, contributing to open source]
99
---
1010

11-
# First Open Source Project – HTML Basics & GitHub Contribution
11+
# First Open Source Project – Making Your First Contribution
1212

1313
## Introduction
1414

15-
In this tutorial, you will learn about HTML elements, attributes, and their values, as well as how to make your first open source contribution directly through GitHub—no command line required!
15+
Welcome to your first open source contribution! In this tutorial, you will learn how to contribute to an open source project directly through GitHub's web interface—no command line required! This is perfect for beginners who want to start contributing to open source projects.
1616

17-
## What Are HTML Attributes?
17+
## What is Open Source?
1818

19-
HTML attributes provide additional information about HTML elements and change their behavior or appearance. They are written inside the opening tag of an element.
19+
Open source software is code that is freely available for anyone to view, use, modify, and distribute. Contributing to open source projects helps you:
20+
- Learn from real-world code
21+
- Build your portfolio
22+
- Connect with the developer community
23+
- Improve your coding skills
24+
- Give back to projects you use
2025

21-
Here is an example of an HTML element with attributes:
26+
## Prerequisites
2227

23-
Go to this repository [https://github.com/sanjay-kv/Open-source-Practice](https://github.com/sanjay-kv/Open-source-Practice)
28+
Before starting, make sure you have:
29+
- A GitHub account (create one at [github.com](https://github.com))
30+
- Basic understanding of Git and GitHub concepts
31+
- Willingness to learn and contribute!
2432

33+
## The Contribution Workflow
34+
35+
The typical open source contribution workflow involves:
36+
1. **Fork** the repository
37+
2. **Edit** the files
38+
3. **Commit** your changes
39+
4. **Create** a pull request
40+
5. **Wait** for review and feedback
41+
42+
Let's walk through each step!
43+
44+
## Step 1: Find the Repository
45+
46+
Navigate to the practice repository: [https://github.com/sanjay-kv/Open-source-Practice](https://github.com/sanjay-kv/Open-source-Practice)
47+
48+
This is a beginner-friendly repository designed for practicing open source contributions.
2549

2650
<BrowserWindow url="https://github.com/sanjay-kv/Open-source-Practice" bodyStyle={{padding: 0}}>
2751
[![GitHub](./assets/23-opensource.png)](https://github.com/sanjay-kv/Open-source-Practice)
2852
<div align="center"><small>Step 1: Repository Home Page</small></div>
2953
</BrowserWindow>
3054

31-
In this example, the `<a>` element is an anchor tag that links to a GitHub repository.
55+
Take a moment to:
56+
- Read the README file to understand the project
57+
- Check if there are contribution guidelines (CONTRIBUTING.md)
58+
- Look at existing issues or pull requests
59+
- Understand what kind of contributions are welcome
3260

33-
## Understanding HTML Attribute Values
61+
## Step 2: Fork the Repository
3462

35-
HTML attribute values define specific settings or properties for attributes. They are assigned to attributes using the `=` sign and enclosed in quotes (`"` or `'`). The value of an attribute can be a string, number, URL, color, or other data types depending on the attribute.
63+
Forking creates your own copy of the repository where you can make changes without affecting the original project.
3664

37-
Here is an example of an HTML element with attribute values:
65+
1. Click the **Fork** button in the top-right corner of the repository page
66+
2. Select your account as the destination
67+
3. Wait for GitHub to create your fork
3868

3969
<BrowserWindow url="https://github.com/sanjay-kv/Learn-GitHub/fork" bodyStyle={{padding: 0}}>
4070
[![GitHub](./assets/21-final-fork.png)](https://github.com/sanjay-kv/Learn-GitHub/fork)
4171
<div align="center"><small>Step 2: Forking the Repository</small></div>
4272
</BrowserWindow>
4373

44-
In this example, the `<img>` element uses attributes like `src`, `alt`, and `width` to define the image source, alternative text, and width.
45-
46-
:::tip
47-
### Best Practices for Using HTML Attributes and Values
48-
49-
- Use attributes to provide additional information about elements and improve accessibility.
50-
- Use attribute values that are relevant and descriptive to enhance the user experience.
51-
52-
By following these best practices, you can create engaging and informative web pages.
53-
:::
54-
55-
## Fork the Repository
56-
5774
<BrowserWindow url="https://github.com/sandemouser/Learn-GitHub" bodyStyle={{padding: 0}}>
5875
[![GitHub](./assets/24-opensource-fork.png)](https://github.com/sandemouser/Learn-GitHub)
59-
<div align="center"><small>Step 3: Fork Button</small></div>
76+
<div align="center"><small>Step 3: Fork Button Location</small></div>
6077
</BrowserWindow>
6178

79+
Once the fork is complete, you'll see:
80+
- Your username in the repository name
81+
- A note saying "forked from [original-repo]"
82+
6283
<BrowserWindow url="https://github.com/sandemouser/Learn-GitHub" bodyStyle={{padding: 0}}>
6384
[![GitHub](./assets/25-opensource-done.png)](https://github.com/sandemouser/Learn-GitHub)
6485
<div align="center"><small>Step 4: Fork Complete</small></div>
6586
</BrowserWindow>
6687

67-
## Edit Files Directly on GitHub
88+
## Step 3: Edit Files Directly on GitHub
89+
90+
One of the great features of GitHub is the ability to edit files directly in your browser without cloning the repository to your computer.
6891

69-
We will follow the process without using command line and edit directly on the page.
92+
### Finding the File to Edit
93+
94+
1. Navigate to the file you want to edit (usually specified in the project's README)
95+
2. Click on the file name to view it
96+
3. Click the **pencil icon** (✏️) in the top-right corner to edit
97+
98+
### Making Your Changes
99+
100+
For this practice repository, you'll typically add your name to a contributors list:
70101

71102
<BrowserWindow url="https://github.com/sandemouser/Learn-GitHub" bodyStyle={{padding: 0}}>
72103
[![GitHub](./assets/26-add-name.png)](https://github.com/sandemouser/Learn-GitHub)
73104
<div align="center"><small>Step 5: Add Your Name</small></div>
74105
</BrowserWindow>
75106

107+
Common first contributions include:
108+
- Adding your name to a contributors list
109+
- Fixing a typo in documentation
110+
- Updating outdated information
111+
- Adding a translation
112+
- Improving README formatting
113+
76114
<BrowserWindow url="https://github.com/sandemouser/Learn-GitHub" bodyStyle={{padding: 0}}>
77115
[![GitHub](./assets/27-added-git-line.png)](https://github.com/sandemouser/Learn-GitHub)
78-
<div align="center"><small>Step 6: Added Git Line</small></div>
116+
<div align="center"><small>Step 6: Changes Made</small></div>
79117
</BrowserWindow>
80118

119+
:::tip Best Practices for Making Changes
120+
121+
- **Keep changes small and focused** - Don't try to fix multiple things at once
122+
- **Follow the project's style** - Match the formatting and conventions used
123+
- **Test your changes** - Make sure links work and formatting is correct
124+
- **Read contribution guidelines** - Many projects have specific requirements
125+
- **Be respectful** - Remember real people maintain these projects
126+
127+
:::
81128

82-
## Commit Your Changes
129+
## Step 4: Commit Your Changes
130+
131+
After making your edits, you need to commit them. A commit is like saving a snapshot of your changes with a description.
132+
133+
### Writing a Good Commit Message
134+
135+
1. Scroll down to the "Commit changes" section
136+
2. Write a clear, concise commit message describing what you changed
137+
3. Optionally add a longer description if needed
138+
4. Select "Commit directly to the main branch" for simple changes
139+
5. Click **Commit changes**
83140

84141
<BrowserWindow url="https://github.com/sandemouser/Learn-GitHub" bodyStyle={{padding: 0}}>
85142
[![GitHub](./assets/28-opensource-commit.png)](https://github.com/sandemouser/Learn-GitHub)
86143
<div align="center"><small>Step 7: Commit Changes</small></div>
87144
</BrowserWindow>
88145

89-
By using attributes and values effectively, you can create engaging and informative web pages that provide a rich user experience.
146+
**Good commit message examples:**
147+
- ✅ "Add John Doe to contributors list"
148+
- ✅ "Fix typo in installation instructions"
149+
- ✅ "Update Python version requirement"
150+
151+
**Poor commit message examples:**
152+
- ❌ "Update"
153+
- ❌ "Changes"
154+
- ❌ "asdfasdf"
90155

91156
<BrowserWindow url="https://github.com/sandemouser/Learn-GitHub" bodyStyle={{padding: 0}}>
92157
[![GitHub](./assets/29-git-final-commit.png)](https://github.com/sandemouser/Learn-GitHub)
93158
<div align="center"><small>Step 8: Final Commit Review</small></div>
94159
</BrowserWindow>
95160

96-
## Create a Pull Request
161+
## Step 5: Create a Pull Request
162+
163+
Now that you've made changes in your fork, it's time to propose those changes to the original repository through a **Pull Request** (PR).
97164

98-
After committing your changes, create a Pull Request to submit your contribution to the original repository.
165+
### What is a Pull Request?
99166

100-
### Steps to Create a Pull Request:
167+
A Pull Request is a way to propose changes to a repository. It allows:
168+
- Project maintainers to review your changes
169+
- Discussion about the proposed modifications
170+
- Automated tests to run on your code
171+
- Iterative improvements before merging
101172

102-
1. Navigate to the original repository
103-
2. Click on **Pull Requests** tab
104-
3. Click **New pull request**
105-
4. Select **Compare across forks**
106-
5. Choose your fork and branch from the dropdowns
107-
6. Review the changes
108-
7. Add a title and description
109-
8. Click **Create pull request**
173+
### Steps to Create a Pull Request
110174

175+
1. **Navigate to the original repository** (not your fork)
176+
2. Click on the **Pull Requests** tab
177+
3. Click the green **New pull request** button
178+
4. Click **Compare across forks**
179+
5. Select your fork and branch from the dropdowns
180+
- Base repository: The original project
181+
- Head repository: Your fork
182+
- Base branch: Usually `main` or `master`
183+
- Compare branch: Your branch with changes
184+
6. Review the changes shown in the diff
185+
7. Click **Create pull request**
186+
8. Add a descriptive title and detailed description
187+
9. Click **Create pull request** again to submit
111188

112189
<BrowserWindow url="https://github.com/sandemouser/Learn-GitHub" bodyStyle={{padding: 0}}>
113190
[![GitHub](./assets/30-opensource-final-check.png)](https://github.com/sandemouser/Learn-GitHub)
114191
<div align="center"><small>Step 9: Create Pull Request</small></div>
115192
</BrowserWindow>
116193

117-
## Comparing Across Forks
194+
### Writing a Good Pull Request Description
195+
196+
Your PR description should include:
197+
- **What** changes you made
198+
- **Why** you made them
199+
- **How** to test the changes (if applicable)
200+
- **Screenshots** (if it's a visual change)
201+
- **Related issues** (if fixing a bug or implementing a feature)
118202

119-
The **Compare across forks** feature allows you to compare changes between your forked repository and the original repository. This helps you review what modifications you've made before submitting your Pull Request.
203+
**Example PR description:**
204+
```
205+
## Description
206+
Added my name to the contributors list as per the contribution guidelines.
120207
121-
This comparison view shows a side-by-side diff of commits and file changes, making it easier to:
208+
## Changes Made
209+
- Added "John Doe" to CONTRIBUTORS.md
210+
- Maintained alphabetical ordering
122211
123-
- Identify added, modified, or deleted lines of code or documentation.
124-
- Ensure that only intended changes are included before proposing a merge.
125-
- Detect any inadvertent or unrelated changes early in the Pull Request process.
126-
- Confirm that your feature branch or fork is updated against the base branch to reduce merge conflicts.
212+
## Checklist
213+
- [x] Followed the project's style guidelines
214+
- [x] Checked for typos
215+
- [x] Read the contribution guidelines
216+
```
127217

128-
You select your fork and branch as the "compare" source and the original repository as the "base." GitHub then displays the exact changes, commits, and file differences between these two.
218+
## Understanding "Compare Across Forks"
129219

130-
Using this feature is a vital step to maintain code quality and smooth collaboration when contributing to open source or shared projects. It helps maintainers and contributors clearly understand the scope and impact of proposed changes before merging.
220+
The **Compare across forks** feature is crucial for creating pull requests from your fork to the original repository.
131221

222+
### What Does It Do?
132223

133-
## Watch this video
224+
This feature allows you to compare changes between:
225+
- Your forked repository (where you made changes)
226+
- The original repository (where you want to contribute)
227+
228+
### Why Is It Important?
229+
230+
The comparison view shows:
231+
- **All commits** you've made since forking
232+
- **File changes** in a diff format
233+
- **Additions** highlighted in green
234+
- **Deletions** highlighted in red
235+
- **Conflict warnings** if there are any
236+
237+
### How to Use It Effectively
238+
239+
1. **Select the correct branches:**
240+
- Base: Original repository's main branch
241+
- Compare: Your fork's branch with changes
242+
243+
2. **Review the diff carefully:**
244+
- Ensure only intended changes are included
245+
- Check for accidental modifications
246+
- Verify formatting is correct
247+
248+
3. **Look for conflicts:**
249+
- Red warnings indicate merge conflicts
250+
- Update your fork if needed
251+
- Resolve conflicts before creating PR
252+
253+
### Benefits of Comparing
254+
255+
- **Prevents mistakes** - Catch unintended changes early
256+
- **Improves quality** - Review your work before submission
257+
- **Reduces conflicts** - Identify issues before they become problems
258+
- **Saves time** - Avoid back-and-forth with maintainers
259+
- **Shows professionalism** - Demonstrates attention to detail
260+
261+
:::warning Important Notes
262+
263+
- Always check the diff before creating a PR
264+
- Make sure you're comparing the right branches
265+
- If you see unexpected changes, fix them before submitting
266+
- Keep your fork updated to avoid conflicts
267+
268+
:::
269+
270+
## Step 6: Wait for Review
271+
272+
After creating your pull request:
273+
274+
1. **Wait patiently** - Maintainers review PRs on their schedule
275+
2. **Respond to feedback** - Be open to suggestions and changes
276+
3. **Make requested changes** - Update your PR based on feedback
277+
4. **Stay professional** - Be courteous and respectful
278+
279+
280+
## Watch This Video Tutorial
281+
282+
For a visual walkthrough of the entire process, watch this helpful video:
134283

135284
<iframe width="883" height="480" src="https://www.youtube.com/embed/R7NReLBCT_8?list=PLrLTYhoDFx-kiuFiGQqVpYYZ56pIhUW63" title="How to do your first opensource on GitHub" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
136285

286+
## Finding Projects to Contribute To
287+
288+
### Beginner-Friendly Resources
289+
290+
- **Good First Issue** labels on GitHub
291+
- [First Timers Only](https://www.firsttimersonly.com/)
292+
- [Up For Grabs](https://up-for-grabs.net/)
293+
- [Good First Issues](https://goodfirstissues.com/)
294+
- [CodeTriage](https://www.codetriage.com/)
295+
296+
### Types of Contributions
297+
298+
You don't have to write code to contribute:
299+
- 📝 **Documentation** - Fix typos, improve clarity, add examples
300+
- 🌐 **Translation** - Translate docs or UI to other languages
301+
- 🐛 **Bug Reports** - Report issues you encounter
302+
- 💡 **Feature Suggestions** - Propose new features
303+
- 🎨 **Design** - Improve UI/UX
304+
-**Testing** - Test new features and report results
305+
- 📊 **Data** - Add datasets or examples
306+
-**Support** - Help answer questions in issues
307+
137308
## Conclusion
138309

139-
HTML attributes and values play a crucial role in web development. You have now learned how to fork a repository, edit files directly on GitHub, commit changes, compare across forks, and create a Pull Request—making your first open source contribution!
310+
Congratulations! You've learned how to make your first open source contribution using only GitHub's web interface. You now know how to:
311+
312+
- ✅ Fork a repository
313+
- ✅ Edit files directly on GitHub
314+
- ✅ Commit changes with meaningful messages
315+
- ✅ Compare changes across forks
316+
- ✅ Create pull requests
317+

0 commit comments

Comments
 (0)