Skip to content

Latest commit

 

History

History
173 lines (113 loc) · 5.61 KB

CONTRIBUTING.md

File metadata and controls

173 lines (113 loc) · 5.61 KB

Contributing

So, you want to contribute to this project! That's awesome. However, before doing so, please read the following simple steps how to contribute. This will make the life easier and will avoid wasting time on things which are not requested. ✨

Discuss the changes before doing them

  • First of all, open an issue in the repository, using the bug tracker, describing the contribution you would like to make, the bug you found or any other ideas you have. This will help us to get you started on the right foot.

  • It is recommended to wait for feedback before continuing to next steps. However, if the issue is clear (e.g. a typo) and the fix is simple, you can continue and fix it.

Steps to follow

Step 1: Star The Repo (Optional)
  • Star the repo by pressing the topmost-right button to start your wonderful journey

star repo


Step 2: Fork this repo

fork image


Step 3: Clone it
  • Method 1: GitHub Desktop

⚠️ NOTE: If you're not familiar with Git, using GitHub Desktop Application is a better start. If you choose this method, make sure to download it before continuing reading.

❗❗ Access link to download here.

  • Method 2: Git

Clone the forked repository. Open git bash and type:

git clone https://github.com/<your-github-username>/Leetcode-c-Solutions.git
cd Leetcode-c-Solutions
git config --global user.name "<your GitHub user name>" && git config --global user.email "your GitHub primary email"

This makes a local copy of the repository in your machine.

⚠️ Replace <your-github-username>!

Learn more about forking and cloning a repo.


Step 4: Create your feature branch

Always keep your local copy of the repository updated with the original repository. Before making any changes and/or in an appropriate interval, follow the following steps:

  • Method 1: GitHub Desktop

Learn more about how to create new branch here and how to fetch and pull origin from/to your local machine here.

Learn more about how to fetch and pull origin from/to your local machine using GitHub Desktop here.

  • Method 2: Git

Run the following commands carefully to update your local repository

# If you cloned a while ago, get the latest changes from upstream
git checkout <master>
git pull upstream <master>

# Make a feature branch (Always check your current branch is up to date before creating a new branch from it to avoid merge conflicts)
git checkout -b <branch-name>

#

Step 5: Ready, Set, Go...

Once you have completed these steps, you are ready to start contributing to the project and creating pull requests.

  • Create a folder if you want to contribute solutions to a new programming language

    The folder name must be the name of the language and the files must be the names of the questions.

  • Write your code and add to the respective folder in the projects directory, locally.
  • Don't forget to add a README.md in your folder.
  • Method 1: GitHub Desktop

Learn more how to pull request from your local machine using GitHub Desktop to the main repo here.

  • Method 2: Git

Add the changes with git add, git commit:

git add -A
git commit -m "<your message>"

Push the code to your repository.

git push origin <branch-name>

make sure you have no conflicts. 🙂 🙂


Step 6: Pull Request

Go to the GitHub page of your fork, and make a pull request:

Read more about pull requests on the GitHub help pages.

  • Now wait, until your Pull Request is approved! If there are any conflicts, you will get a notification.

Wait for feedback

Before accepting your contributions, we will review them. You may get feedback about what should be fixed in your modified code. If so, just keep committing in your branch and the pull request will be updated automatically.

Everyone is happy! 🤗

Finally, your contributions will be merged, and everyone will be happy! 😄 Contributions are more than welcome!

Thanks! 😅