Skip to main content
Dan Rodney/1 min read

Create a New Local Git Repository (Initialize Repository)

Resolve a Merge Conflict

1

Identify Conflicts

git status shows files with conflicts after a failed merge.

2

Open the Files

Look for <<<<<< / ====== / >>>>>> markers — your changes vs theirs.

3

Edit & Stage

Pick the right code, remove markers, git add the file.

4

Complete the Merge

git commit finalizes the merge with the resolved content.

Build Programming Foundations at Noble Desktop

Noble Desktop's Full-Stack Web Development Certificate teaches Git alongside the modern web stack — a must for any developer.

Explore in-depth, the nuts and bolts of Git repositories—understanding what they contain, how to initialize one, navigate them using Visual Studio Code, and effectively utilize Source Control panel.

Git Repositories

A Git repository (or repo for short) contains all of the project files and the entire revision history. You’ll take an ordinary folder of files (such as a website’s root folder), and tell Git to make it a repository. This creates a .Git subfolder, which contains all of the Git metadata for tracking changes.

On Unix-based operating systems such as macOS, files and folders that start with a period (.) are hidden, so you will not see the .Git folder in the macOS Finder unless you show hidden files, but it’s there. You won’t ever need to go into the .Git folder, so don’t worry about not being able to see it.

TIP: On macOS you can show or hide invisible files by hitting Cmd–Shift-Period(.)

Initialize a Git Repo

  1. Open a project folder in Visual Studio Code.

    You can do this by going to File > Open (Mac) or File > Open Folder (Windows), navigate to the folder, select it, and hit Open (Mac) or Select Folder (Windows).

  2. Open the Source Control panel on the left of the window.
  3. In the Source Control panel click Initialize Repository.