Script Valley
Open Source Contribution: A Practical Guide
Git Workflow for Contributors/Assessment

Practice & Assessment

Test your understanding of Git Workflow for Contributors

Multiple Choice Questions

5
1

After forking a repo, what remote name should you assign to the original repository?

2

Which command safely force-pushes after a rebase, failing if someone else pushed to the branch since your last pull?

3

What does the Conventional Commits type chore indicate?

4

You have a conflict in config.js after running git rebase upstream/main. What is the correct sequence to resolve it?

5

What is the primary reason to keep pull requests small and focused on a single issue?

Coding Challenges

1
1

Git History Cleaner Script

Write a shell script that audits the last N commits on the current branch (N passed as argument, default 10) and flags commits whose messages do not follow Conventional Commits format. For each flagged commit, print the short SHA, the offending message, and a suggested fix. A valid commit matches: ^(feat|fix|docs|style|refactor|test|chore)(\(.+\))?: .{1,72}$. Input: integer N (number of recent commits). Output: list of non-compliant commits with suggested corrections. Estimated time: 20-25 minutes.

Medium

Mini Project

1

Contribute a Real Fix to a Public Repository

Find a real open source project with a good first issue labeled bug or documentation fix. Complete the full contributor workflow: fork the repo, sync with upstream, create a properly named branch, make the fix, write commit messages following the project conventions, resolve any conflicts that arise, and open a real pull request. Document every step in a CONTRIBUTION_LOG.md file: the issue chosen, branch name and why, commit messages written, any conflicts encountered and how resolved, and a link to your actual PR. This project applies the complete fork-branch-commit-PR cycle from every lesson in this module.

Medium