Thank you for your interest in contributing to CofiBlocks! We appreciate your time and effort in making our project better.
This guide will help you get started with contributing to our project. Please note that we have a code of conduct, which we expect all contributors to adhere to.
We welcome contributions from the community! Here's how you can help:
-
Clone and Fork Repo: Click the Fork button in the top-right corner to create a copy of the repository under your account.
-
Clone the Fork:
- Clone the forked repository to your local machine by running the following command:
git clone https://github.com/YOUR_USERNAME/REPOSITORY_NAME.git
- Replace
YOUR_USERNAME
andREPOSITORY_NAME
with your GitHub username and the repository name.
-
Create a new branch or use the main branch: When modifying contracts kindly make sure the formatting is correct and all tests pass successfully.
- Create a branch name based on the type of change (e.g.,
feat/name-related-issue
,docs/name-related-issue
).
git checkout -b branch-name
-
One of ideas on how to implement it for the branch name:
docs/update-readme
orfix/bottom-bug
.
- Create a branch name based on the type of change (e.g.,
-
Commit: Commit your changes.
- git add (file-name)
- git commit -m "[type] description"
- Example:
git add Create_Documentation git commit -m "[docs]: update documentation"
- Push fork: Push to your fork and submit a pull request on our
main
branch. Please provide us with some explanation of why you made the changes you made. For new features make sure to explain a standard use case to us.
-
Push your changes to your forked repository:
git push origin your-branch-name
Replace
your-branch-name
with the name of your branch. -
Example:
git push origin fix/bug-fix
-
Submit a Pull Request: Submit a pull request to the
main
branch of the CofiBlocks repository.
- Check your remote.
git remote -v
- If you don't see
upstream
, add it.
git remote add upstream https://github.com/Vagabonds-Labs/cofiblocks.git
- Bring the latest changes from the original repository.
git fetch upstream
- Switch to the
main
branch of your local repository.git checkout main
- Merge
upstream/main
changes to your local branch.git merge upstream/main
- Upload the changes to your fork in GitHub.
git push origin main
- Change to the branch you want to update.
git checkout name-of-your-rama
- Take an overflow with the updated
main
branch.
git rebase main
- Upload the changes to your fork.
git push origin name-of-your-rama --force
- Local changes without saving.
- Save changes temporarily
git stash
- Then update and recover your changes.
git stash pop
- Untracked files causing conflict.
- Delete them if you don't need them
rm filename
You can do a regular commit by following the next:
[type] significant message
Add changes you worked on the issue.
Examples:
git commit -m "[docs]: update documentation"
git commit -m "[fix]: fix bug in code"
git commit -S -m "[test]: add test case"
Other Example:
- If you wnat to sign your commits, you can use the
-S
flag.
git commit -S -m "[refactor]: Changes in the code"
- There must be a
main
branch, used only for the releases. - Avoid long descriptive names for long-lived branches.
- Use kebab-case (no CamelCase).
- Use grouping tokens (words) at the beginning of your branch names (in a similar way to the
type
of commit). - Define and use short lead tokens to differentiate branches in a way that is meaningful to your workflow.
- Use slashes to separate parts of your branch names.
- Remove your branch after merging it if it is not important. Examples:
git branch -b docs/readme
git branch -b test/a-feature
git branch -b feat/sidebar
git branch -b fix/b-feature