-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
TemplateTemplate issueTemplate issue
Description
- Run the commands that creates the poem
- Run the commands that creates the branches
- Create a setting in your team's
.gitconfigthat makescurrentthe default push strategy - Push all your changes (hint there at three new branches! - and a tag!)
One of the most important reasons for using git is its ability to merge files - it's the number one collaboration tool in our industry.
I makes sense to study and understand exactly what a git merge is.
Three-way-merge
Git uses (default) a standard three-way-merge when it merges files.
It's a simple algorithm.
- Two (2) files must be merged
- They have a (1) common ancestor - 2+1=3 - hence the name - three-way--merge
- Each contributing file is line-by-line compared against the common ancestor
- Change rules if one of the contributors has either deleted, added or altered a line in the file, then that change also goes into the result.
- If both contributors have different opinions about the same line - then it's a conflict
Let's stir the pot and potentially create a conflict - which we can then solve.
- Create a directory in the root of the repository called
merge-lab - Add a file
poem.txtwith the following poem:Eeny, meeny, miny, moe, Catch a tiger by the toe. If he hollers, let him go, Eeny, meeny, miny, moe. My mother told me to pick the very best one and you - are - it!" - Use the
gitCLI toaddandcommitthe poem to git. - Use
git tagto create a tag namedancestor - Use
git pushto push it to GitHub - make sure that the also the tag is pushed!
After you have seen it on GitHub go back to the file and make a change to the file.
- Change the enden exclamation mark
!to a puntuation. - use
gitCLI toadd,commit,push.
Metadata
Metadata
Assignees
Labels
TemplateTemplate issueTemplate issue