Skip to content

Commit 2f0876b

Browse files
shivaylambaSenVeer2001
authored andcommitted
challenge 7
add challenge 8 9 add 10th challenge Update challenge10.md Update challenge10.md update #2 11 Task 12 Completed Signed-off-by: shivaylamba <[email protected]> challenge 13 add challenge 14 Update challenge14.md Create challenge15.md Update challenge15.md Update challenge15.md Update challenge15.md Create challenge16.md Create challengers-list.md chall 17 Signed-off-by: shivaylamba <[email protected]> Update challengers-list.md add challenge 18 19 Signed-off-by: shivaylamba <[email protected]> add chall 20 task Day 13 Completed
1 parent b5a197c commit 2f0876b

File tree

17 files changed

+568
-38
lines changed

17 files changed

+568
-38
lines changed

.github/workflows/linter.yaml

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,39 @@
1-
name: Lint Code Base
2-
3-
on:
4-
push:
5-
branches-ignore: [master, main]
6-
# Remove the line above to run when pushing to master
7-
pull_request:
8-
branches: [master, main]
9-
10-
jobs:
11-
build:
12-
# Name the Job
13-
name: Lint Code Base
14-
# Set the agent to run on
15-
runs-on: ubuntu-latest
16-
17-
##################
18-
# Load all steps #
19-
##################
20-
steps:
21-
##########################
22-
# Checkout the code base #
23-
##########################
24-
- name: Checkout Code
25-
uses: actions/checkout@v3
26-
with:
27-
# Full git history is needed to get a proper list of changed files within `super-linter`
28-
fetch-depth: 0
29-
30-
################################
31-
# Run Linter against code base #
32-
################################
33-
- name: Lint Code Base
34-
uses: github/super-linter@v4
35-
env:
36-
VALIDATE_ALL_CODEBASE: false
37-
DEFAULT_BRANCH: main
38-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1+
name: Lint Code Base
2+
3+
on:
4+
push:
5+
branches-ignore: [master, main]
6+
# Remove the line above to run when pushing to master
7+
pull_request:
8+
branches: '*detail*' # Run it on details branch only
9+
10+
jobs:
11+
build:
12+
# Name the Job
13+
name: Lint Code Base
14+
# Set the agent to run on
15+
runs-on: ubuntu-latest
16+
17+
##################
18+
# Load all steps #
19+
##################
20+
steps:
21+
##########################
22+
# Checkout the code base #
23+
##########################
24+
- name: Checkout Code
25+
uses: actions/checkout@v3
26+
with:
27+
# Full git history is needed to get a proper list of changed files within `super-linter`
28+
fetch-depth: 0
29+
30+
################################
31+
# Run Linter against code base #
32+
################################
33+
- name: Lint Code Base
34+
uses: github/super-linter@v4
35+
env:
36+
VALIDATE_ALL_CODEBASE: false
37+
DEFAULT_BRANCH: main
38+
FILTER_REGEX_EXCLUDE: .*Challenges/.* # Ignore Challenges/ markdown files
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Challenges/challenge10.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## Welcome to Challenge 10
2+
3+
Welcome to the 10th challenge!
4+
5+
Today's let's try to use the concept for Git Rebase you learnt but on a Pull Request.
6+
7+
8+
Task:
9+
1. Checkout to the branch you created in Challenge 3 in your forked repository.
10+
11+
2. Create another commit by making some change in the markdown file (`<YOUR-GITHUB-USERNAME>.md`) you created in Challenge 5 and push the change to your forked repository.
12+
13+
3. Now, we will use the concept of Git Rebase to squash the last two commits into one commit.
14+
15+
4. For this. Review the commits you've made on the branch using the git log --oneline command. You should see a number of commits on the branch. Use the interactive rebase command to squash the commits.
16+
17+
5. In the interactive rebase editor, change the word pick to squash (or s) for the commits you want to combine. Save and close the editor. Edit the combined commit message when prompted. Force push the changes to your forked repository.
18+
19+
6. Check if the commit reflects in the Pull request you created in Challenge 5 in the main challenge repository.
20+
21+
( If it does not, then sync your forked repository with the main repository and push the changes to your forked repository.)
22+
23+
7. Take the screenshot of the terminal when you have successfully used the git rebase to squash the commits and post it in the comment created in the first challenge (challenge 1).
24+

Challenges/challenge11.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## Welcome to Challenge 11
2+
3+
Welcome to the 11th Challenge
4+
5+
Today's challenge involves how to use ``git stash`` command effectively. You can refer on how to stash your commits [here](https://git-scm.com/book/en/v2/Git-Tools-Stashing-and-Cleaning)
6+
7+
Task:
8+
1. Inside the branch you created in the previous challenge (challenge 3) ``your_github_username-details`` create a new file inside the directory ``contributors/<YOUR-GITHUB_USERNAME>/`` directory.
9+
2. Use the git stash command to move these changes to the stash area
10+
3. Delete the content from the stash area and share a screenshot of this inside the Github issue you created in the first challenge.
11+

Challenges/challenge12.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## Welcome to Challenge 12
2+
3+
Welcome to the 12th challenge!
4+
5+
Today's challenge is based on the concept of signing your commits. Signing the commits is a way of showing that only authentic commits are being made.
6+
7+
A lot of open source projects have DCO which stands for [Developer Certification of Origin](https://github.com/apps/dco) including this repository itself and it tries to verify that each commit is signed or not. In case your commit is not signed it will reflect in the pull request that it doesn't pass the DCO test.
8+
9+
You can read more about how to sign commits [here](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)
10+
11+
Task:
12+
1. Setup the ability to sign commits locally in your systems
13+
2. Whenever committing in the future always try to use signed commits
14+
3. Make a new signed commit to the pull request that you have made in previous challenges by making this change to the ``<YOUR-GITHUB-USERNAME>.md`` file:
15+
```
16+
---
17+
name: your_name
18+
github_user_name: YOUR-GITHUB-USERNAME
19+
url_of_github_issue: Link_of_the_github_issue_created_in_first_challenge
20+
your_favroite_programming_language: Add your favorite programming language here
21+
---
22+
```

Challenges/challenge13.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## Welcome to Challenge 13th
2+
3+
Welcome to the 13th Challenge
4+
5+
Today we will be learning to work with GitHub Gists.
6+
7+
Github Gists are a great way to share ideas and code snippets with others.
8+
9+
#### Brief Overview
10+
11+
GitHub Gist is two fold and you can either use it for sharing ideas or sharing smaple code. It supports **Markdown**
12+
To learn more, vist:
13+
- [Learn more about GitHub gist](https://help.github.com/en/enterprise/2.13/user/articles/about-gists)
14+
15+
## Task
16+
17+
- Create a gist writing on any software development related topic that interests you
18+
- Create a gist sharing a small code snippet in your preferred programming language
19+
20+
## How to Submit
21+
22+
- Create your submission a markdown file named ``gist-solutions.md`` and add it inside the branch ``your_github_username-details`` used in previous challenges
23+
- In your submission file add the links to your **2 gists**
24+
- Ensure you push it so that it reflects inside your Pull request created in previous challenges
25+
26+
Do remember to update your forum post on Discord with today's task completion and screenshot

Challenges/challenge14.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## Welcome to Challenge 14
2+
3+
Welcome to the 14th Challenge
4+
5+
Today's challenge is a re-practice of the 8th and 9th Challenge.
6+
7+
So focus for this challenge will be to practice the ``git rebase`` command.
8+
9+
Ensure to practice the ``git rebase`` command by creating your own local git repository. You can checkout this guide: https://www.freecodecamp.org/news/git-squash-explained/
10+
11+
Task:
12+
1. Practice git rebase, and how to squash commit using git rebase in your local projects. For this you can make some changes in the branch and the file created in Challenge 3 & 5.
13+
2. Once done, try to squash the commits in your pull request in the Challenge repository.
14+
3. Also do sign your commits, covered in the Challenge 12.

Challenges/challenge15.md

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
## Welcome to Challenge 15
2+
3+
Congratulations on successfully completing the 14th challenge! This marks the completion of the second milestone of the challenge.
4+
5+
Before you proceed with the 15th challenge, ensure you are required to have completed the following tasks to successfully mark the completion of the 2nd milestone:
6+
7+
## Preqrequisites to mark completion of 2nd Checkpoint (Milestone):
8+
9+
1. Use the creative shared for the successful completion of the second milestone: [Second Milestone Creative](https://github-production-user-asset-6210df.s3.amazonaws.com/129844674/268165917-34df9c63-be61-4ffc-af43-264703f89f0a.jpg) to share on any social platform: LinkedIn, Twitter, Facebook, Instagram, etc. marking the completion of the second milestone.
10+
11+
2. Fill the Google form the following Google form: [Google Form](https://forms.gle/JnzBURSEjRejEgw4A) to mark the completion of the second milestone. Note: This is a mandatory task to be eligible for the prize at the end of the challenge as it allows us to evaluate the submissions in the challenge so far.
12+
13+
14+
Once you have completed the above, you can proceed with the 15th challenge.
15+
16+
17+
## Task:
18+
Welcome to the 15th challenge!
19+
20+
Read this [article on merge conflicts](https://www.atlassian.com/git/tutorials/using-branches/merge-conflicts) as it is very important.
21+
22+
Today is the first part of a two-part challenge related to resolving merge conflicts. To get started, follow these steps:
23+
24+
Task:
25+
Create a Scenario for Merge Conflict:
26+
27+
- Create a new project on your local system (e.g., a code project or a text file).
28+
29+
- Intentionally make changes to the same lines of code or content in different branches of your project to create a scenario where a merge conflict would occur during a merge or pull request.
30+
Resolve the Merge Conflict:
31+
32+
- Follow the steps outlined in this [article](https://www.atlassian.com/git/tutorials/using-branches/merge-conflicts) to understand how to resolve merge conflicts.
33+
34+
- Use the techniques mentioned in the article to resolve the conflict you intentionally created in your project.
35+
36+
- Share Screenshot: Take a screenshot of your terminal or Git client when you are resolving the merge conflict.
37+
38+
- Share this screenshot in the issue you created during the first challenge (Challenge 1) to demonstrate that you have successfully resolved a merge conflict.
39+
40+
41+
42+
43+
### Sample Example for merge conflict
44+
Here is an example of a merge conflict:
45+
46+
47+
Step 1: Set Up Your Repository
48+
a. Create a new directory on your computer for your Git project:
49+
50+
```
51+
mkdir merge-conflict-example
52+
cd merge-conflict-example
53+
```
54+
55+
b. Initialize the directory as a Git repository:
56+
57+
```
58+
git init
59+
```
60+
61+
Step 2: Create Two Branches
62+
a. Create a new branch called feature-branch:
63+
64+
```
65+
git checkout -b feature-branch
66+
67+
```
68+
b. Create a file and make some changes in it. For example, create a file named example.txt and add the following content:
69+
70+
```
71+
This is some content on the feature branch.
72+
```
73+
74+
c. Stage and commit your changes:
75+
76+
```
77+
git add example.txt
78+
git commit -m "Add feature branch content"
79+
80+
```
81+
d. Switch back to the main (or master) branch:
82+
83+
```
84+
git checkout main
85+
```
86+
e. Make changes to the same file, example.txt, in the main branch. For example:
87+
88+
```
89+
This is some content on the main branch.
90+
```
91+
92+
f. Stage and commit your changes on the main branch:
93+
```
94+
git add example.txt
95+
git commit -m "Add main branch content"
96+
```
97+
98+
Step 3: Create a Merge Conflict
99+
a. Attempt to merge the feature-branch into main:
100+
101+
```
102+
git merge feature-branch
103+
```
104+
105+
At this point, you'll encounter a merge conflict because both branches have made changes to the same part of the example.txt file.
106+
107+
108+
Step 4: Resolve the Merge Conflict
109+
a. Open the example.txt file in your code editor.
110+
111+
b. You'll see Git's conflict markers, which look like this:
112+
113+
```
114+
<<<<<<< HEAD
115+
This is some content on the main branch.
116+
=======
117+
This is some content on the feature branch.
118+
>>>>>>> feature-branch
119+
```
120+
121+
c. Manually edit the file to decide which changes to keep. Remove the conflict markers and choose the content you want to keep. For example:
122+
123+
```
124+
This is some content on the main branch.
125+
126+
This is some additional content on the feature branch.
127+
```
128+
129+
d. Save the file.
130+
131+
132+
Step 5: Commit the Resolved Merge Conflict
133+
a. Stage the resolved file:
134+
135+
```
136+
git add example.txt
137+
```
138+
139+
b. Commit the changes:
140+
141+
```
142+
git commit -m "Resolve merge conflict"
143+
```
144+
145+
Now, you've successfully created a scenario for a merge conflict, resolved it, and committed the changes. You can use these steps as a practical exercise to understand how merge conflicts work in Git.
146+
147+
148+
149+
150+
151+

Challenges/challenge16.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
## Welcome to Challenge 16
2+
3+
Welcome to the 16th Challenge
4+
5+
6+
Before taking part. Fill out the Google Form to officially submit your progress for Checkpoint 2 in the challenge: https://forms.gle/JnzBURSEjRejEgw4A
7+
8+
9+
In this 2 part challenge, we will try to emulate and fix merge conflicts via git.
10+
11+
Today is the first part of this challenge:
12+
13+
Task:
14+
1. Sync Your Repository:
15+
16+
- Update your Forked Repository From the Original [Main Repository](https://github.com/scaleracademy/scaler-open-source-september-challenge) locally. Also ensure that your branch ``your_github_username-details`` is also synced with the latest changes from the original repository.
17+
18+
2. In your branch ``your_github_username-details`` open the ``challengers-list.md`` file.
19+
Add your name to the list of challengers, following the format specified in the file.
20+
21+
22+
3. Push your changes to reflect them in the Pull Request created in previous challenges.
23+
Please note that by adding your name to the same file in a collaborative environment, this task may create a merge conflict when multiple participants attempt to push their changes simultaneously. Be prepared to resolve any conflicts that arise.
24+
25+
26+
4. Add a new comment to the issue you created in the first task with the screenshot of the updated ``challengers-list.md`` file in your forked repository.
27+
28+
29+
30+
Note: Next Challenge: Challenge 17 will focus on resolving merge conflicts.
31+

0 commit comments

Comments
 (0)