Инструменты пользователя

Инструменты сайта


git:razreshenie_konfliktov

Разрешение конфликтов

anchikin@outlook.com@Asus MINGW64 /d/apache/htaccess/www (branch2)
$ git branch -v #Просмотр веток
* branch2 4e977b0 commit branch2
  branch3 daa7ef2 other user
  master  4d4b2b8 [ahead 1] branch master commit
 
anchikin@outlook.com@Asus MINGW64 /d/apache/htaccess/www (branch2)
$ git checkout master #Переключаемся на ветку master
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)
 
anchikin@outlook.com@Asus MINGW64 /d/apache/htaccess/www (master)
$ git merge branch2 #Пытаемся смержить ветки, автоматически
Auto-merging file.html
CONFLICT (content): Merge conflict in file.html
Automatic merge failed; fix conflicts and then commit the result. #Автоматически не удалось
 
anchikin@outlook.com@Asus MINGW64 /d/apache/htaccess/www (master|MERGING) 
#Подключаем стороннюю программу http://kdiff3.sourceforge.net/
$ git config --global mergetool.kdiff3.cmd '"c:\\Program Files\\KDiff3\\kdiff3" $BASE $LOCAL $REMOTE -o $MERGED'
 
anchikin@outlook.com@Asus MINGW64 /d/apache/htaccess/www (master|MERGING)
$ git mergetool #Запускаем стороннюю программу, в ней разрешаем конфликты
Merging:
file.html
 
Normal merge conflict for 'file.html':
  {local}: modified file
  {remote}: modified file
 
 
 
 
anchikin@outlook.com@Asus MINGW64 /d/apache/htaccess/www (master|MERGING)
$ git status #Проверяем статус репы, видим лишние файлы после объединения веток, удаляем их
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)
 
All conflicts fixed but you are still merging.
  (use "git commit" to conclude merge)
 
Untracked files:
  (use "git add <file>..." to include in what will be committed)
 
        file.html.orig
        file_BACKUP_6104.html
        file_BASE_6104.html
        file_LOCAL_6104.html
        file_REMOTE_6104.html
 
 
anchikin@outlook.com@Asus MINGW64 /d/apache/htaccess/www (master|MERGING)
$ git status #Удалив файлы смотрим репу видим что все ок
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)
 
All conflicts fixed but you are still merging.
  (use "git commit" to conclude merge)
 
 
anchikin@outlook.com@Asus MINGW64 /d/apache/htaccess/www (master|MERGING)
$ git add . #На всякий случай обновим индекс в папке .git
 
anchikin@outlook.com@Asus MINGW64 /d/apache/htaccess/www (master|MERGING)
$ git commit -m"merger" #Делаем коммит
[master d0d7e64] merger
 
anchikin@outlook.com@Asus MINGW64 /d/apache/htaccess/www (master)
$ git status # коммит прошел благополучно
On branch master
Your branch is ahead of 'origin/master' by 3 commits.
  (use "git push" to publish your local commits)
 
nothing to commit, working tree clean
 
anchikin@outlook.com@Asus MINGW64 /d/apache/htaccess/www (master)
$ git branch -v
  branch2 4e977b0 commit branch2
  branch3 daa7ef2 other user
* master  d0d7e64 [ahead 3] merger
git/razreshenie_konfliktov.txt · Последние изменения: 2023/01/12 12:18 (внешнее изменение)