Hello 👋 This document is a guide to both onboard new contributors in contributing to our repositories and hub-docs repository in general. Thanks a lot for considering to contribute! 🤗
(if this is a code PR, if not, skip these two steps!) Firstly, please give a read to the contribution guidelines. It will save both your and maintainers’ time, you will get to learn about developer setup, style guide and more!
Before solving something that you think is missing/broken, make sure to open an issue and discuss with core maintainers 🙂 if you see the issue exists, make sure you discuss with core maintainers about design decisions (especially if it's a big thing to solve!)
Ping the maintainers in the issue saying you are interested in contributing to a project.
To get started with writing code:
Your fork looks like this:
Make changes to your fork. The easiest way to work in this repository is to press “.” while you’re in your fork to let GitHub web IDE open. Another way is to clone the repository through your computer (if this is a code change you shouldn’t use GitHub IDE). https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository 🤖
hub-docs/tasks/src/tabular-classification/about.md
. Add your changes, commit and push them to your fork, like below 👇See what’s changed in the repository with:
git status
Add the changed files with git add like below:
git add tasks/src/fill-mask/about.md
(or alternatively use git add .
to add all the changes you see in git status)
Commit your work with a message:
git commit -m "added changes"
Push:
git push
Pro tip: It’s usually that you will see people doing git add .
. This means that you’d like to add all the changed files and commit them. While solving a problem or doing a documentation, you might be generating files that are irrelevant to your PR, or making changes (e.g. editing .gitignore
which is something we’ve seen a lot!). It’s best if you add changed files, or changed folders, e.g. above you see tasks folder is modified, you can directly do git add tasks
to add the changes in whole folder.
If you don’t think your work is done yet you’d like the maintainers to skim through your code (which is often useful if you’re designing an API or writing something from scratch) open draft PR instead!
So essentially, what happens is that you were trying to write your changes to this repository's main branch. However, since you opened the PR, some changes occurred to that branch in the same files you're modifying. Because of this, there's a conflict. Git says that "for fifth line of the code you wanted to write this, but this line is now changed, so it's better if you adapt your changes on top of these changes".
Because you're working on a fork of original repository, first you need to have the changes (for main branch) To do so, simply sync your fork first:
Then on your local repository, do a git pull
while you're on main branch of your fork. Then, merge changes from main branch to the branches that your PRs are based on, so that those branches are updated too! This will bring the changes on your local and raise a merge conflict that you can solve through your IDE. It looks like below:
When making changes, think of how you want the document to look like and accept/reject changes accordingly. It's encouraged that you respect other contributors' contributions and append your changes on top of theirs. (Unless it's a fix!)
Once you resolve the conflicts, simply add, commit and push your changes.