1. 8
    Practical Git: Resolve merge conflicts with git status
    4m 36s

Practical Git: Resolve merge conflicts with git status

Trevor Miller
InstructorTrevor Miller

Share this video with your friends

Send Tweet

Sometimes when you run git merge (also during a git pull which runs a git merge) you get a merge "conflict"; this means that the same line(s) of code were changed locally as in new changes in the remote (most likely from another developer working on a related feature); git merge can automatically merge all other changes but when the same line is modified in two places, you have to fix the conflict manually. In this lesson, we show how a conflict happening from a git pull, and then how to fix it using git status to update the conflict markers in our file(s) with conflicts. You can use a graphical app for this, but this lesson will show you how to resolve conflicts directly from the command line and your code editor.

Carlos Núñez
Carlos Núñez
~ 3 years ago

Hi Trevor,

There is a silly mistake in your explanation at 3:35. You should pass space-separated values. Since name.split(' ') is splitting spaces, it won't give you the expected result if the string passed has not spaces.

Otherwise, you can swap split('') and also join(' ')

function getInitials(name) {
  return name.split('')
    .map(word => `${word.charAt(0)}.`).join(' ')

It is not related to the git explanation which is good though.