Welcome to the GitHub repository for coding challenges! This guide will walk you through the process of creating a branch under your name and uploading your solution files step by step. If you are new to Git and GitHub, follow these instructions carefully.
If you haven't installed Git yet, download and install it from Git's official website.
If you donβt have a GitHub account, create one at GitHub.
- Go to the repository URL shared by your instructor.
- Click on the Fork button in the top-right corner to create a copy in your GitHub account.
-
Open Terminal (Linux/macOS) or Command Prompt/Powershell (Windows).
-
Run the following command, replacing
your-usernamewith your GitHub username:git clone https://github.com/WeCode-Community-Dev/blind-75-challenge.git
-
Navigate into the repository folder:
cd blind-75-challenge
Each student must create a separate branch with their name before making any changes.
-
Check the current branches:
git branch
-
Create a new branch with your name (make sure this is unique - add some unique number or characters to make sure it is not already there):
git checkout -b your-branch-name
-
Verify the branch was created and switched to it:
git branch
Your name should now be highlighted, meaning you are on that branch.
Before working on a new challenge, ensure your repository is up to date.
-
Add the original repository as the upstream remote (only required once):
git remote add upstream https://github.com/WeCode-Community-Dev/blind-75-challenge.git
-
Fetch the latest changes:
git fetch upstream
-
Merge the latest changes into your branch:
git merge upstream/main
Upload only the solution file for each challenge (e.g., solution.py, solution.cpp, solution.java).
you can name the file .py or .cpp or .java etc.
example: two-sum.py or two-sum.cpp or two-sum.java as per the programming language you choose
- Navigate to the folder for the challenge you are working on.
- Place your solution file inside the appropriate challenge folder.
Example structure:
repository-name/
β-- Challenge-1/
β β-- solution.py # Your file
β-- Challenge-2/
β β-- solution.cpp # Another file
Replace the "challenge-1" with problem name
-
Add the file you modified:
git add Challenge-1/solution.py
-
Commit your changes with a meaningful message:
git commit -m "Added solution for Challenge 1" -
Push your branch to your GitHub repository:
git push origin your-branch-name
Once you've pushed your changes, you need to create a Pull Request (PR).
- Go to your GitHub repository.
- Switch to your branch (
your-branch-name). - Click on Compare & pull request.
- Add a meaningful title and description.
- Click Create pull request.
Your code will now be reviewed and merged by the instructor! π
β Always create a branch under your name. β Upload only the solution file (no unnecessary files or folders). β Keep your repository updated by pulling the latest changes. β Use meaningful commit messages. β Create a pull request for every challenge.
Happy coding! π