FOSS β First Issue π
Issue Type
FOSS Β· Beginner Β· Open for All π
Contribution Rules β
- Branch:
foss only
- Original content only (No AI usage, otherwise Straight PR Rejection)
Objective
To understand how merge conflicts happen and how to correctly resolve them in real open-source workflows. (foss Branch)
Setup
Create a folder with your GitHub Username inside the task-01 folder.
Inside your GithubId folder, create a file named data.txt with the following content:
OpenCode FOSS Wing β Merge Conflict Task
Line 1: Learning real-world Git workflows.
Line 2: This line will be modified differently in two branches.
Line 3: Git conflicts are normal in open source.
Line 4: I am learning how to resolve them properly.
1. Edit in the original foss branch
Switch to foss branch:
Edit Line 2 in data.txt to:
This line is modified in the foss branch.
Commit:
git commit -am "Modified line 2 in foss branch"
2. Create Branch A and edit
Create and switch:
git checkout -b foss-task01-a
Edit Line 2 to:
This line is modified in Branch A.
Commit:
git commit -am "Branch A change"
3. Switch back to foss and edit again
Edit Line 2 to:
This line is modified again in foss branch.
Commit:
git commit -am "Second change in foss branch"
4. Create the conflict
5. Resolve the conflict
Resolve Line 2 to:
This line is modified in Branch A and foss branch.
Then commit:
git add data.txt
git commit -m "Resolved merge conflict in data.txt"
6. Push to foss
Take a screenshot and attach it in your Pull Request description.
PR Submission
data.txt exists
- Conflict is resolved correctly
- Screenshot attached
- Commit history shows both branches and merge commit
Answer the following question in your own Language in PR Description
- What was the differnece between
git commit -m "..." and git commit -am "...".
- What was the main cause for the merge conflict according to you?
Pull Request Rejection Criteria β
- Wrong branch
- Unauthorized changes
- Incomplete/inaccurately solved issue
FOSS β First Issue π
Issue Type
FOSS Β· Beginner Β· Open for All π
Contribution Rules β
fossonlyObjective
To understand how merge conflicts happen and how to correctly resolve them in real open-source workflows. (
fossBranch)Setup
Create a folder with your GitHub Username inside the
task-01folder.Inside your
GithubIdfolder, create a file named data.txt with the following content:1. Edit in the original
fossbranchSwitch to
fossbranch:Edit Line 2 in
data.txtto:Commit:
git commit -am "Modified line 2 in foss branch"2. Create Branch A and edit
Create and switch:
Edit Line 2 to:
Commit:
git commit -am "Branch A change"3. Switch back to
fossand edit againEdit Line 2 to:
Commit:
git commit -am "Second change in foss branch"4. Create the conflict
5. Resolve the conflict
Resolve Line 2 to:
Then commit:
git add data.txt git commit -m "Resolved merge conflict in data.txt"6. Push to
fossTake a screenshot and attach it in your Pull Request description.
PR Submission
data.txtexistsAnswer the following question in your own Language in PR Description
git commit -m "..."andgit commit -am "...".Pull Request Rejection Criteria β