-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Labels
Points: 20open-for-allAny one can work on it without getting assigned, every PR can mergeAny one can work on it without getting assigned, every PR can merge
Description
FOSS β First Issue π
Issue Type
FOSS Β· Beginner Β· Open for All π
Contribution Rules β
- Branch:
fossonly - 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:
git checkout fossEdit 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-aEdit 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
git checkout fossEdit Line 2 to:
This line is modified again in foss branch.
Commit:
git commit -am "Second change in foss branch"4. Create the conflict
git merge foss-task01-a5. 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
git push origin fossTake a screenshot and attach it in your Pull Request description.
PR Submission
data.txtexists- 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 "..."andgit 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
Metadata
Metadata
Assignees
Labels
Points: 20open-for-allAny one can work on it without getting assigned, every PR can mergeAny one can work on it without getting assigned, every PR can merge