-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test vue * new error added * doc indiv new page added * major update on doc page * husky removed * some minor issue fix * code clean up + code optimize for color
- Loading branch information
Showing
14 changed files
with
217 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[ | ||
{ | ||
"title": "pull_request_tutorial_for_beginners" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
Pull requests (PRs) are a crucial part of collaborative software development, especially in open-source projects. They allow developers to propose changes to a codebase, which can then be reviewed and discussed by others before being merged. This tutorial will guide you through the process of creating a pull request. | ||
|
||
## Prerequisites | ||
|
||
- Basic knowledge of Git and GitHub. | ||
- A GitHub account. | ||
- Git installed on your computer. | ||
|
||
## Step 1: Fork the Repository | ||
|
||
1. Navigate to the repository you want to contribute to on GitHub. | ||
2. Click the "Fork" button at the top right of the page. This will create a copy of the repository under your GitHub account. | ||
|
||
## Step 2: Clone Your Fork | ||
|
||
Clone the forked repository to your local machine: | ||
|
||
```bash | ||
git clone https://github.com/your-username/repository-name.git | ||
``` | ||
Replace your-username with your GitHub username and repository-name with the name of the repository. | ||
|
||
|
||
## Step 3: Create a New Branch | ||
|
||
Navigate into the cloned repository: | ||
|
||
```bash | ||
cd repository-name | ||
``` | ||
|
||
Create and switch to a new branch for your changes: | ||
```bash | ||
git checkout -b feature-branch-name | ||
``` | ||
|
||
Choose a descriptive name for your branch, such as fix-bug-123 or add-feature-xyz. | ||
|
||
## Step 4: Make Your Changes | ||
|
||
Make the necessary changes to the codebase. You can use any code editor of your choice. | ||
|
||
## Step 5: Commit Your Changes | ||
|
||
```bash | ||
git add . | ||
git commit -m "Brief description of your changes" | ||
``` | ||
|
||
Write a clear and concise commit message that describes what you have done. | ||
|
||
## Step 6: Push Your Changes | ||
|
||
Push your changes to your forked repository: | ||
|
||
```bash | ||
git push origin feature-branch-name | ||
``` | ||
|
||
## Step 7: Create a Pull Request | ||
|
||
1. Go to your forked repository on GitHub. | ||
2. You should see a banner suggesting to compare & pull request. Click on it. If not, navigate to the "Pull requests" tab and click "New pull request." | ||
3. Make sure the base repository is the original repository and the base branch is where you want to merge your changes (usually main or master). | ||
4. The compare branch should be the branch you pushed your changes to. | ||
5. Write a title and description for your pull request. Provide details on what changes you made and why. | ||
6. Click "Create pull request." | ||
|
||
## Step 8: Address Feedback | ||
|
||
Once your pull request is created, other contributors or maintainers may review it and leave feedback. Be prepared to make additional changes based on this feedback. | ||
|
||
**To make changes:** | ||
1. Make the required changes on your local branch. | ||
2. Commit and push the changes: | ||
```bash | ||
git add . | ||
git commit -m "Addressed feedback on XYZ" | ||
git push origin feature-branch-name | ||
``` | ||
The pull request will automatically update with your new commits. | ||
|
||
## Step 9: Merge the Pull Request | ||
|
||
Once your pull request has been approved, a maintainer will merge it into the base branch. In some projects, you may have permission to merge it yourself. | ||
|
||
## Step 10: Clean Up | ||
|
||
After your pull request has been merged, you can clean up your local repository by deleting the branch: | ||
|
||
```bash | ||
git checkout main | ||
git pull origin main | ||
git branch -d feature-branch-name | ||
``` | ||
```javascript | ||
|
||
useEffect(() => { | ||
const fetchDocs = async () => { | ||
try { | ||
const response = await fetch('/posts/index.json'); | ||
if (!response.ok) { | ||
throw new Error('Network response was not ok'); | ||
} | ||
const data = await response.json(); | ||
setDocs(data); | ||
} catch (error) { | ||
setError(error.message); | ||
} finally { | ||
setLoading(false); | ||
} | ||
}; | ||
|
||
fetchDocs(); | ||
}, []); | ||
|
||
``` | ||
You may also delete the branch from your fork on GitHub. | ||
|
||
Congratulations! You've successfully created and merged a pull request. This process helps maintain code quality and encourages collaboration among developers. | ||
|
||
This tutorial covers the basics of creating a pull request and includes best practices to help beginners understand the process. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,29 @@ | ||
import { useState, useEffect } from "react"; | ||
|
||
const useColorBorderBox = (error = "") => { | ||
const [errorTypeColor, setErrorTypeColor] = useState("#7e1aa5"); | ||
|
||
useEffect(() => { | ||
if (error.type == "add") { | ||
return setErrorTypeColor("#4024e0"); | ||
} | ||
if (error.type == "branch") { | ||
return setErrorTypeColor("#ff0000"); | ||
} | ||
if (error.type == "push") { | ||
return setErrorTypeColor("#8d54e1"); | ||
} | ||
if (error.type == "merge") { | ||
return setErrorTypeColor("#118d7c"); | ||
} | ||
if (error.type == "commit") { | ||
return setErrorTypeColor("#1a5ba5"); | ||
} | ||
return setErrorTypeColor("#7e1aa5"); | ||
}, [errorTypeColor]); | ||
const useColorBorderBox = (errorType = "") => { | ||
const [errorTypeColor, setErrorTypeColor] = useState("#7e1aa5"); | ||
|
||
let item = error.type; | ||
useEffect(() => { | ||
if (errorType == "add") { | ||
return setErrorTypeColor("#4024e0"); | ||
} | ||
if (errorType == "branch") { | ||
return setErrorTypeColor("#099104"); | ||
} | ||
if (errorType == "push") { | ||
return setErrorTypeColor("#8d54e1"); | ||
} | ||
if (errorType == "merge") { | ||
return setErrorTypeColor("#118d7c"); | ||
} | ||
if (errorType == "commit") { | ||
return setErrorTypeColor("#1a5ba5"); | ||
} | ||
return setErrorTypeColor("#7e1aa5"); | ||
}, [errorType]); | ||
|
||
let response = `py-4 mb-4 col-span-12 md:col-span-6 xl:col-span-4 px-2 md:px-6 border-l-4 rounded-lg items-start bg-dark/5 dark:bg-white/5 backdrop-blur-[10px] flex flex-col hover:scale-105 duration-300 ${ | ||
item === "add" | ||
? "border-[#4024e0]" | ||
: item === "commit" | ||
? "border-[#1a5ba5]" | ||
: item === "merge" | ||
? "border-[#118d7c]" | ||
: item === "push" | ||
? "border-[#8d54e1]" | ||
: item === "cmd" | ||
? "border-[#e100ff]" | ||
: item === "branch" | ||
? "border-[#ff0000]" | ||
: "border-[#7e1aa5]" | ||
}` | ||
|
||
return response | ||
return { errorTypeColor, setErrorTypeColor }; | ||
} | ||
|
||
export default useColorBorderBox; |
Oops, something went wrong.