$ git checkout main
$ git merge --no-ff develop
$ git checkout main
$ git merge develop
- This is documentation
- This is documentation
- It contains lots of info
- This is documentation
- New feature info
- It has lots of info
$ git merge develop
Auto-merging Docs.md
CONFLICT (content): Merge conflict in Docs.md
Automatic merge failed; fix conflicts and then commit the result.
- This is documentation
<<<<<<< HEAD
- It contains lots of info
=======
- New feature info
- It has lots of info
>>>>>>> develop
- This is documentation
- It contains lots of info
- New feature info
# Разрешим конфликт выбором файла из коммита, к которому мы откатываемся.
$ git checkout --their Docs.md
Updated 1 path from the index
$ git status
On branch main
You have unmerged paths.
(fix conflicts and run "git commit")
(use "git merge --abort" to abort the merge)
Changes to be committed:
new file: new_feature.py
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: Docs.md
# Добавим наш файл в индекс.
$ git add Docs.md
# Ради интереса посмотрим статус
$ git status
On branch main
All conflicts fixed but you are still merging.
(use "git commit" to conclude merge)
Changes to be committed:
modified: Docs.md
new file: new_feature.py
# Продолжим слияние.
$ git merge --continue
[main a219fa1] L-04: Merge branch 'develop'
$ git merge develop
Auto-merging colors.txt
CONFLICT (content): Merge conflict in colors.txt
Automatic merge failed; fix conflicts and then commit the result.
<<<<<<< HEAD
This color is red,
And this one is blue.
Check out the base
To make conflict solved by you!
=======
this color is (255, 36, 0)
and this one is (0, 191, 255)
check out the base
to make conflict solved by you
>>>>>>> develop
$ git config --global merge.conflictstyle diff3
$ git merge --abort
$ git merge develop
<<<<<<< HEAD
This color is red,
And this one is blue.
Check out the base
To make conflict solved by you!
||||||| 8b5b982
this color is red
and this one is blue
check out the base
to make conflict solved by you
=======
this color is (255, 36, 0)
and this one is (0, 191, 255)
check out the base
to make conflict solved by you
>>>>>>> develop
This color is (255, 36, 0),
And this one is (0, 191, 255).
Check out the base
To make conflict solved by you!
$ git mergetool
$ git rebase main
$ git rebase --continue
git rebase --skip
git rebase --abort
git reset --hard ORIG_HEAD
git rebase -i HEAD~3
GNU nano 4.8 /home/smartiqa/Desktop/test/.git/rebase-merge/git-rebase-todo
pick f831285 C
pick c06b382 D
pick 0874316 E
# Rebase f831285..0874316 onto 2a50e6e (3 commands)
#
# Commands:
# p, pick <commit> = use commit
# r, reword <commit> = use commit, but edit the commit message
# e, edit <commit> = use commit, but stop for amending
# s, squash <commit> = use commit, but meld into previous commit
# f, fixup <commit> = like "squash", but discard this commit's log message
# x, exec <command> = run command (the rest of the line) using shell
# b, break = stop here (continue rebase later with 'git rebase --continue')
# d, drop <commit> = remove commit
# l, label <label> = label current HEAD with a name
# t, reset <label> = reset HEAD to a label
# m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]
# . create a merge commit using the original merge commit's
# . message (or the oneline, if no original merge commit was
# . specified). Use -c <commit> to reword the commit message.
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
#
reword f831285 C
pick c06b382 D
pick 0874316 E
# Rebase f831285..0874316 onto 2a50e6e (3 commands)
#
# Commands:
# p, pick <commit> = use commit
# r, reword <commit> = use commit, but edit the commit message
# e, edit <commit> = use commit, but stop for amending
# s, squash <commit> = use commit, but meld into previous commit
# f, fixup <commit> = like "squash", but discard this commit's log message
# x, exec <command> = run command (the rest of the line) using shell
# b, break = stop here (continue rebase later with 'git rebase --continue')
# d, drop <commit> = remove commit
# l, label <label> = label current HEAD with a name
# t, reset <label> = reset HEAD to a label
# m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]
# . create a merge commit using the original merge commit's
# . message (or the oneline, if no original merge commit was
# . specified). Use -c <commit> to reword the commit message.
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
# Ветка main (Основная стабильная ветка)
geometric_lib
├── circle.py
├── square.py
└── docs
└── README.md
# Ветка develop (Ветка разработки)
geometric_lib
├── circle.py
├── square.py
└── docs
└── README.md
└── calculate.py
# Ветка feature (Ветка для новых функций)
geometric_lib
├── circle.py
├── square.py
└── docs
└── README.md
└── rectangle.py
# Ветка release
geometric_lib
├── circle.py
├── square.py
└── docs
└── README.md
└── user_agreement.txt
# п 1. Клонируем репозиторий и активируем локальные ветки
$ git clone https://github.com/smartiqaorg/geometric_lib.git
$ cd geometric_lib/
$ git checkout develop
$ git checkout release
$ git log --all --pretty=oneline --graph
# п 2. Работа с веткой develop
$ git checkout main
$ git merge develop --no-ff
$ git log --all --pretty=oneline --graph
$ git reset --hard HEAD^
$ git log --all --pretty=oneline --graph
$ git merge develop --ff
$ git log --all --pretty=oneline --graph
# п 3. Работа с веткой release
$ git config merge.conflictstyle diff3
$ git config --global merge.tool meld
$ git checkout release
$ git rebase -i main
$ git mergetool
$ git rebase --continue
$ git mergetool
$ git rebase --continue
$ git log --all --pretty=oneline --graph
$ git checkout main
$ git merge release --ff
$ git log --pretty=oneline --graph