gitpractice.dev

brew-timer — Ch.10 · Contribute from a fork

Exercise 1 of 6

Before you start

Forks

You cannot push to a project you are not a member of. Instead you fork it: the hosting service makes a copy of the repository under your name, which you may change freely.

Forking is a button on the website, not a git command. Yours is already made, and cloned: origin is your fork.

A pull request across repositories

Make your change on a new branch, not on main: your main should stay a plain copy of the original. Push the branch to your fork, then open a pull request that asks the original project to take it.

Press "Write the code" to make the change, and the Pull request button above the code to propose it. Only the maintainers of the original can merge it.

git switch -c <branch>
create a branch and move to it
git commit -am "What you changed"
stage tracked changes and commit
git push -u origin <branch>
put the branch on your fork
You can reopen this any time with “Lesson”.

Continue on a desktop

Typing git on a small screen is no fun. Open this page on a laptop or desktop to practise.

Back to the path