Skip to content

Latest commit

 

History

History

exercise-3

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Exercise-3

In this exercise, you'll practice creating and merging branches. You should complete this exercise by creating your own repository to work with.

Set up

To set up the repository, take the following steps:

  • Create a new repository on GitHub with a README.md file.
  • Clone the repository to your machine

Making branches

In this section, you'll create a new branch, and practice switching between branches.

  • Create a new branch called new-feature
  • Checkout your new branch (you can do this in the same line as the last step, if you like)
  • Edit your README.md file by adding a line (line #2) that says Changes on new-feature branch
  • Then, add and commit you changes (note, this commit will only appear on your new-feature branch)

Merging changes

In this section, you'll switch branches, make changes, then create a merge conflict when you attempt to merge in changes.

  • Switch back to your master branch
  • Edit your README.md file by adding a line (line #2) that says Changes on master branch
  • Then, add and commit you changes (note, this commit will only appear on your master branch)
  • Merge in changes from your new-feature branch (it should result in a merge conflict)
  • Edit your README.md file to make it appear exactly as you want it (i.e., select changes from your desired branch)
  • You'll then have to add your changes, and make a new commit to reflect your merge
  • You can then push your changes (all changes) back up to GitHub