Transferring Knowledge Between Git Areas

Screenshot

Once students have completed the three areas, it can be instructive to solve a few transfer questions.

Branching – committing

Rationale Example Questions
  • Start with the most recent commit and continue with commits in the history of the branch, given that the recent commits are consulted relatively often compared to analyzing and editing older commits.
  • How do the different options to restore changes from the last commit (soft/mixed/hard reset, revert) differ?
  • How does switch/checkout/reset/revert affect the areas, i.e., the working directory and staging area? Why do we need a clean working directory?
  • How can we enter the ‘detached HEAD mode’ and for which purposes could it be useful?
  • How can older commits be edited and what is the effect of rewriting history on the following commits?

Branching – collaborating

Rationale Example Questions
  • Proceed from single-branch synchronization to workflows in highly collaborative settings, which can involve forks, more remotes, and more complex branching models.
  • What would you expect if you push a branch with a divergent history?
  • Why should ‘rewriting history’ be avoided when pushing shared branches?
  • How does ‘Git pull –rebase’ work and when is it useful?
  • How are local branches associated with remote branches? How are ‘tracking branches’ set up during push or pull?
  • How can changes from your local branch be contributed to a remote repository owned by another maintainer? If you continue your development on the branch, how can these changes be contributed?

Committing – collaborating

Rationale Example Questions
  • Proceed from simple linear commits to merging strategies in collaborative settings, in which community conventions must be considered.
  • How does GitHub’s web-based functionality to edit and commit files work? Are the working directory and staging area available on GitHub?
  • What is the difference between merge, rebase, and squash options in pull requests?
  • In the context of merging or squashing pull-requests, what is the difference between committer and author?