Giter Site home page Giter Site logo

merge-conflict's Introduction

Your GitHub Learning Lab Repository for Managing Merge Conflicts

Welcome to your repository for your GitHub Learning Lab course. This repository will be used during the different activities that I will be guiding you through.

Oh! I haven't introduced myself...

I'm the GitHub Learning Lab bot and I'm here to help guide you in your journey to learn and master the various topics covered in this course. I will be using Issue and Pull Request comments to communicate with you. In fact, I already added an issue for you to check out.

issue tab

I'll meet you over there, can't wait to get started!

There are already some Pull Requests open, you will work on those later in the course.

merge-conflict's People

Contributors

hollenberry avatar beardofedu avatar hectorsector avatar

Watchers

James Cloos avatar Ivan Boldyrev avatar

merge-conflict's Issues

Welcome

Welcome to Managing Merge Conflicts ๐ŸŽ‰

Hello, and welcome! If you're here to learn about and practice resolving merge conflicts, you're in the right place.

In this course, you'll solve a total of four merge conflicts, and you'll understand why merge conflicts happen. All of the merge conflicts in this course will be simple enough to solve from within the GitHub.com user interface, but if you'd prefer to solve them using the command line or other local tools, the course will still work.

As an added bonus, the project we are using for this course is a resume hosted on GitHub Pages! So, if you want to keep working after you complete this course, please feel free!

Note: You may notice that some branches and pull requests already exist. We'll be using them in later activities in this course.

How merge conflicts happen

Version control is all about making incremental changes to your code or file base. We'll start with the standard workflow, and add a few pictures to help us form a mental model.

Git operates as a linked list. A small history of three commits ๐Ÿ“– might look like this:

three commits in a linked list format

In the GitHub Flow, you...

  • create a new branch ๐Ÿ“– (which is really just a reference point to a commit)

add a branch

  • add one or more commits (which occur on that branch only, while the other commits stay fixed to their reference point in history)

branch with new commit

  • and then create a pull request ๐Ÿ“–, optionally add more commits, and then merge ๐Ÿ“– and delete your branch!

Merge conflicts happen when someone else made a change on the master branch in the same file and location where you were making changes. This usually happens when someone else merges in their branch before you merge yours.

Have no fear, Git knows how to handle this -- and it is why Git creates merge conflicts.

Step 1: Create a Pull Request

Before we get too far ahead of ourselves, let's practice making a simple change on a branch. Visualize your actions using the mental model above.

โŒจ๏ธ Activity: Create a normal pull request

  1. On the Code tab, click the _data/skills.yml file
  2. Click the โœ๏ธ icon to enter edit mode
  3. In the file, add a skill or two that you're proficient in.
  4. Scroll the bottom and select the option to "Create a new branch for this commit and start a pull request"
  5. Replace the default patch branch name with change-skills
  6. Select Propose file change
  7. Write some text in the "Leave a comment" field of the pull request
  8. Click Create pull request
  9. ๐Ÿšง Don't merge yet! ๐Ÿšง Refresh the pull request to receive the next comment/instructions.

For a printable version of the steps in this course, check out the Quick Reference Guide.


Look for my next response in your pull request

Sometimes I respond too fast for the page to update! If you perform an expected action and don't see a response from me, wait a few seconds and refresh the page for your next steps.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.