Skip to content

lab 27 Creating a Conflict

Goals

Switch back to main and create a conflict

Switch back to the main branch and make this change:

Execute:

git checkout main

lib/hello.js

const rl = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout,
});

module.exports.sayHello = () => {
  rl.question(`What's your name? `, (name) => {
    console.log(`Hello ${name}!`);
  });
};

Execute:

git add lib/hello.js
git commit -m "Made interactive"

View the Branches

Execute:

git hist --all

Output:

$ git hist --all
*   8c53c97 2019-06-27 | Merge branch 'main' into greet (greet) [Halle Bot]
|\  
* | f52644d 2019-06-27 | Updated package [Halle Bot]
* | 455c54f 2019-06-27 | Hello uses Greeter [Halle Bot]
* | 4fb8bde 2019-06-27 | Added greeter class [Halle Bot]
| | * 3c663d0 2019-06-27 | Made interactive (HEAD -> main) [Halle Bot]
| |/  
| * 3aa3064 2019-06-27 | Added README [Halle Bot]
|/  
* 2b04803 2019-06-27 | Added a package.json. [Halle Bot]
* b65b430 2019-06-27 | Moved hello.js to lib [Halle Bot]
* 4535421 2019-06-27 | Add an author/email comment [Halle Bot]
* 59992ce 2019-06-27 | Added a comment (tag: v1) [Halle Bot]
* 20a6c79 2019-06-27 | Added a default value (tag: v1-beta) [Halle Bot]
* 6915d41 2019-06-27 | Using process.argv [Halle Bot]
* 284070d 2019-06-27 | First Commit [Halle Bot]

Main at commit “Added README” has been merged to the greet branch, but there is now an additional commit on main that has not been merged back to greet.

Up Next

The latest change in main conflicts with some existing changes in greet. Next we will resolve those changes.