Skip to content

Latest commit

 

History

History
45 lines (44 loc) · 2.45 KB

CONT-CLI-09_Pulling-changes.md

File metadata and controls

45 lines (44 loc) · 2.45 KB
layout leadingpath title pre-requisites learning-objective screens additional-labs additional-questions resources
module
../
Pulling Changes from the Remote
CONT-CLI-08_Workflow-review
Pulling changes from the remote into your local repository.
image-slide
title image presenter-script
Pulling Changes from the Remote
push-pull.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 pull to retrieve changes from the remote. When we pull the files from the remote git downloads a copy of the new commits that have been added to the branch since our last pull and then attempts to merge them into our local branch.
video-slide
title video video-script production-notes
Pulling 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 pull`
Now we will type git pull. Git already knows that our local branch master is related to the remote branch master, so we do not need to tell git where to pull from.
do say
Show output
After the pull is complete, git provides a report of the changes that were pulled from the remote and lets us know they were successfully merged.
do say
Type `git branch`
You will notice that, even though you deleted the branch on GitHub, the local copy of your branch still exists.
do say
Type `git branch --merged`
To see which local branches have already been merged into master, you can add the --merged option to the git branch command. Your branch should be listed. Generally, this means it is safe to delete the branch.
do say
Type `git branch -d <branch-name>`
To delete the branch, simply use the git branch command with the -d option.
lab
title id presenter-script steps
Pulling Changes
CONT-CLI-09-lab-01
Let's update your local copy of the repository.
description id
Retrieve the changes from the remote.
CONT-CLI-09-pull