GithubHelp home page GithubHelp logo

git-three-way-merges-talk's People

Stargazers

 avatar

Watchers

 avatar  avatar

git-three-way-merges-talk's Issues

Testing a 2-way merge

Bildschirmfoto 2021-03-16 um 23 45 57

Preparation:

[2021-03-14 13:39:43] fiedl@fiedl-mbp ~/code/git-2-way-merge-test
▶ git init

[2021-03-14 13:39:45] fiedl@fiedl-mbp ~/code/git-2-way-merge-test master
▶ git co --orphan foo
▶ cat test
B
C

[2021-03-14 13:42:26] fiedl@fiedl-mbp ~/code/git-2-way-merge-test foo ⚡
▶ git commit

[2021-03-14 13:42:46] fiedl@fiedl-mbp ~/code/git-2-way-merge-test foo
▶ git co --orphan bar
▶ cat test
A
B
C
D

Merge foo into bar

[2021-03-14 13:44:53] fiedl@fiedl-mbp ~/code/git-2-way-merge-test bar
▶ git merge --allow-unrelated-histories foo

Merge bar into foo

[2021-03-14 13:53:11] fiedl@fiedl-mbp ~/code/git-2-way-merge-test foo
▶ git merge --allow-unrelated-histories bar

Result

Both merges create a merge conflict between BC and ABCD.

<<<<<<<
B
C
|||||||
=======
A
B
C
D
>>>>>>>

Print git graph for earlier-history scenario

Bildschirmfoto 2021-03-14 um 22 28 08

[2021-03-14 22:25:29] fiedl@fiedl-mbp ~/code/git-import-history-test
▶ git init
▶ git branch -m main

▶ git commit --allow-empty -m "A baz"  # f5ba326
▶ git commit --allow-empty -m "B blah"
▶ git commit --allow-empty -m "C blub"

▶ git co --orphan earlier-history
▶ git commit --allow-empty -m "D foo"
▶ git commit --allow-empty -m "E bar"
▶ git commit --allow-empty -m "F baz"

▶ git co f5ba326
▶ git co -b temp
▶ git merge --allow-unrelated-histories --no-ff earlier-history -m "H merging F into temp"
▶ git merge --no-ff main -m "I merging main into temp"

▶ git co main
▶ git merge --no-ff temp -m "G import earlier history"

[2021-03-14 22:33:07] fiedl@fiedl-mbp ~/code/git-import-history-test main
▶ git graph
*   11d2886 (HEAD -> main) G import earlier history
|\
| *   25f295d (temp) I merging main into temp
| |\
| |/
|/|
* | 88d186f C blub
* | 1449115 B blah
| * 6360243 H merging F into temp
|/|
| * e3963db (earlier-history) F baz
| * 6502ae2 E bar
| * c94efc3 D foo
* f5ba326 A baz

Testing a 3-way merge

Bildschirmfoto 2021-03-16 um 23 46 47

Preparation

[2021-03-14 14:08:12] fiedl@fiedl-mbp ~/code/git-3-way-merge-test
▶ git init

[2021-03-14 14:09:28] fiedl@fiedl-mbp ~/code/git-3-way-merge-test main
▶ cat test
A
B
C

[2021-03-14 14:09:23] fiedl@fiedl-mbp ~/code/git-3-way-merge-test main ⚡
▶ git commit -m "commit ABC on main"  # 4b69425

[2021-03-14 14:10:26] fiedl@fiedl-mbp ~/code/git-3-way-merge-test main ⚡
▶ cat test
A
B
C
D

[2021-03-14 14:10:38] fiedl@fiedl-mbp ~/code/git-3-way-merge-test main ⚡
▶ git commit -m "commit ABCD on main"

[2021-03-14 14:10:58] fiedl@fiedl-mbp ~/code/git-3-way-merge-test main
▶ git co 4b69425
▶ git co -b foo
▶ cat test
B
C

[2021-03-14 14:12:02] fiedl@fiedl-mbp ~/code/git-3-way-merge-test foo ⚡
▶ git commit -m "commit BC on foo"

Merge foo into main with base 4b69425

[2021-03-14 14:12:45] fiedl@fiedl-mbp ~/code/git-3-way-merge-test main
▶ git merge-base main foo
4b694250ad510bb37a7676334258df85c1e8f8a0

[2021-03-14 14:12:54] fiedl@fiedl-mbp ~/code/git-3-way-merge-test main
▶ git merge foo
automatischer Merge von test
Merge made by the 'recursive' strategy.

[2021-03-14 14:13:09] fiedl@fiedl-mbp ~/code/git-3-way-merge-test main
▶ cat test
B
C
D

Works as expected. ✅

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.