Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a poem #5

Open
11 tasks
lakruzz opened this issue Feb 12, 2023 · 0 comments
Open
11 tasks

Create a poem #5

lakruzz opened this issue Feb 12, 2023 · 0 comments
Labels
Template Template issue

Comments

@lakruzz
Copy link
Member

lakruzz commented Feb 12, 2023

  • Run the commands that creates the poem
  • Run the commands that creates the branches
  • Create a setting in your team's .gitconfig that makes current the 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.txt with 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 git CLI to add and commit the poem to git.
  • Use git tag to create a tag named ancestor
  • Use git push to 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 git CLI to add, commit, push.
@lakruzz lakruzz added the Template Template issue label Feb 12, 2023
@lakruzz lakruzz changed the title Create a potential conflcit Create a potential conflict Feb 12, 2023
@lakruzz lakruzz changed the title Create a potential conflict Create a poem Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Template Template issue
Projects
None yet
Development

No branches or pull requests

1 participant