You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
.gitconfig
that makescurrent
the default push strategyOne 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.
Let's stir the pot and potentially create a conflict - which we can then solve.
merge-lab
poem.txt
with the following poem:git
CLI toadd
andcommit
the poem to git.git tag
to create a tag namedancestor
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.
!
to a puntuation.
git
CLI toadd
,commit
,push
.The text was updated successfully, but these errors were encountered: