Bitpath

Lesson 2 · Unit 04

Collaboration

Rejected pushes, pull, force and pull requests

13 exercisesabout 3 min

What you practise

  • A rejected push and why, pull with merge vs rebase, --force-with-lease and when force is acceptable, pull requests as a conversation around a branch

Try a question from this lesson

Pick one

Ana and Bo both clone when main is at commit A. Ana pushes B. Bo, who has not fetched, commits C on top of A and pushes. What should the server do?

The idea

Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.

Concept

Push only fast-forwards

A push asks the other repository to move its branch to your commit. It agrees only if that is a fast-forward: your commit must already contain theirs.

If someone pushed first, bring their commits into your branch with git pull, then push again. Pull is a fetch plus either a merge or a rebase.

origin:  A --- B      main
you:     A --- C      main

C does not contain B: push rejected

11 more exercises in the app

  • 3× type the answer
  • 1× fill the blanks
  • 4× multiple choice
  • 1× true or false
  • 1× order the lines
  • 1× match the pairs

Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.

One email when Bitpath is ready to try. Nothing else. Privacy