Skip to content

lab 51 Merging Pulled Changes

Goals

Merge the fetched changes into local main

Execute:

git merge origin/main

Output:

$ git merge origin/main
Updating 7d55044..a3d1a30
Fast-forward
 README         | 1 +
 Rakefile       | 7 +++++++
 hello.rb       | 1 -
 lib/greeter.rb | 8 ++++++++
 lib/hello.rb   | 7 +++++++
 5 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 README
 create mode 100644 Rakefile
 delete mode 100644 hello.rb
 create mode 100644 lib/greeter.rb
 create mode 100644 lib/hello.rb

Check the README again

We should see the changes now.

Execute:

cat README

Output:

$ cat README
This is the Hello World example from the git tutorial.
(changed in original)

There are the changes. Even though “git fetch” does not merge the changes, we can still manually merge the changes from the remote repository.

Up Next

Next let’s take a look at combining the fetch & merge process into a single command.