42. 3. git push 失敗
$ git push
To http://gitlab.example.com/tmiyahar/test.git
! [rejected] main -> main (fetch first)
error: failed to push some refs to 'http://gitlab.example.com/tmiyahar/test.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
42
43. 4. git pullするとコンフリクト発生
$ git pull
(rebase関係の設定をしろとhintが出るがとりあえず今回は無視)
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), 232 bytes | 232.00 KiB/s, done.
From http://gitlab.example.com/tmiyahar/test
77eb748..9cb63b7 main -> origin/main
Auto-merging README.md
CONFLICT (content): Merge conflict in README.md
Automatic merge failed; fix conflicts and then commit the result.
43
44. 5. 6. コンフリクト修正と再push
$ vi README.md
$ git commit -a
[main 2705f27] Merge branch 'main' of
http://gitlab.example.com/tmiyahar/test
$ git push
Enumerating objects: 10, done.
Counting objects: 100% (10/10), done.
Delta compression using up to 16 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (6/6), 537 bytes | 537.00 KiB/s, done.
Total 6 (delta 0), reused 0 (delta 0), pack-reused 0
To http://gitlab.example.com/tmiyahar/test.git
9cb63b7..2705f27 main -> main
44