Skip to content
Foxipa
Code Completion 4 Challenges

Complete the Git commands: Git Pull: Fetching and Integrating Remote History

Create a disposable bare repository and two working clones. Publish an initial commit, then create a new remote commit from the second clone. In the first clone, record HEAD and the remote-tracking tip, run an explicit `git pull --ff-only origin main`, and verify that the local branch advances to the fetched commit without creating a merge commit. Then create independent local and remote commits from a common base and compare `git pull --ff-only origin main` with `git pull --no-rebase origin main` in separate disposable repositories. Record which state changes occur in each case and verify that no pull command publishes local commits back to the remote.

Intermediate ~6 min read

Challenge 1

Complete the Git command to fetch and integrate remote history.

bash Your answer
git  --ff-only origin main

Press Ctrl⌘Enter to check your answer

Challenge 2

Complete the Git command to fetch and integrate remote history.

bash Your answer
git  --no-rebase origin main

Press Ctrl⌘Enter to check your answer

Challenge 3

Complete the Git command to fetch and integrate remote history.

bash Your answer
git 

Press Ctrl⌘Enter to check your answer

Challenge 4

Complete the Git command to fetch and integrate remote history.

bash Your answer
git  <remote> <refspec>

Press Ctrl⌘Enter to check your answer