First, fork the repository, and star it if you like. To contribute, create a local copy of the repository by running the following command in your terminal:
git clone https://github.com/<your-username>/Competitive-Programming
Ensure to replace your-username
with your GitHub username. You must fork the repository before cloning it.
Once cloned, navigate to the repository directory:
cd Competitive-Programming
Now, create a new branch to make your changes. Name the branch after your username:
git branch <your-branch-name>
Replace your-branch-name
with your desired branch name, preferably your username, to avoid conflicts.
To start working on your new branch, switch to it by running:
git checkout <your-branch-name>
You will get a confirmation that you've successfully switched to your branch.
Add your solution in any programming language. Be sure to:
After making changes, sync them to the repository. Start by adding all changes:
git add .
Now, commit your changes with a descriptive message:
git commit -m "ADD YOUR MESSAGE HERE (E.g., SOLVED HACKERRANK PROBLEM)"
Commit messages should describe where the problem was solved, like "FROM HACKERRANK" or "FROM LEETCODE". Use all caps for platform names.
Next, push your changes to your branch:
git push --set-upstream origin <your-branch-name>
Now, add the upstream remote repository:
git remote add upstream https://github.com/chaudharypraveen98/Competitive-Programming
Periodically, sync your repository with the upstream repository to stay updated:
git fetch upstream
git checkout master
git merge upstream/master
Once your changes are ready, go to your forked repository and click on New Pull Request. Follow the on-screen instructions to complete the PR submission.
Congratulations! You've successfully created a Pull Request!
Lastly, don't forget to update the corresponding issue if opened.
Please add your name in the list in the following format:
- Name - [File Name](File Address)