Skip to content

Latest commit

 

History

History
43 lines (42 loc) · 2.2 KB

EXT-CLI-01_Fetching-changes.md

File metadata and controls

43 lines (42 loc) · 2.2 KB
layout leadingpath title pre-requisites learning-objective screens additional-labs additional-questions resources
module
../
Fetching Changes from the Remote
CONT-CLI-08_Workflow-review
Fetch changes from the remote and merge them into your local repository.
image-slide
title image presenter-script
Fetching Changes from the Remote
push-fetch-merge.jpg
Frequently, collaborators will make changes to our files during the Pull Request process. Before we can go on, we will need to update our local copy of the file.
We use push to send our changes to the remote, but we use fetch or pull to retrieve changes from the remote. When we fetch the files from the remote we download a read-only copy of the new commits that have been added to the branch since our last fetch. We will then need to merge these read only copies into our local branch.
video-slide
title video video-script production-notes
Fetching Changes from the Remote
do say
Open the CLI
Let's go back to our terminal window.
do say
Type `git checkout master`
Since our changes have already been merged to master on the remote, let's go ahead and checkout to our master branch.
do say
Type `git fetch origin`
Now we will type git fetch. We will include origin to tell Git that it is fetching from the remote.
do say
Type `git status`
After the fetch is complete, let's check our status.
do say
Type `git merge origin/master`
Finally, we will type git merge. When we do a merge, we must be checked out to the branch we are merging into. In the merge command, we tell Git which branch we would like to merge into our local branch. In this case, it is origin/master.
lab
title id presenter-script steps
Fetching Changes
CONT-EXT-CLI-01-lab-01
Let's fetch the changes made on the remote.
description id
Fetch the changes.
EXT-CLI-01-fetch
description id
Merge the fetched changes into your local copy of the repository.
EXT-CLI-01-merge