本番環境でgit pullを行ったときにエラーが出ました。
error: Your local changes to the following files would be overwritten by merge:
	composer.json
	composer.lock
Please, commit your changes or stash them before you can merge.
Abortingコンフリクトが起きたようす。マージする前にコミットするかスタッシュしてくださいとのこと。
そうだ、Composerで管理しているいくつかのパッケージのバージョンアップをしたことを思い出した。
今回は、リモートリポジトリのファイルに置き換えて問題ない。
ステータスを確認してみます。
$ git status
# On branch main
# Your branch is behind 'origin/main' by 7 commits, and can be fast-forwarded.
#   (use "git pull" to update your local branch)
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#	modified:   composer.json
#	modified:   composer.lock
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#	package-lock.json
no changes added to commit (use "git add" and/or "git commit -a")Changes not staged for commit: で表示されているファイルがコンフリクトのファイルと同じ。ファイルの変更を取り消しても問題ないので git checkout します。
$ git checkout . 
# ファイルを特定して実行する場合
$ git checkout ファイル名これで、もう一度 git pull してみると上手くいきました。
コンフリクトのマージが必要な場合は、git stash で一時退避させて、今すぐやりたい作業をしてから、退避した変更を戻して作業を再開という方法があります。
# 作業を一時退避
$ git stash
# 退避した作業を確認
$ git stash list
# 退避した作業を復元
$ git stash pop  // 最新の作業
$ git stash pop stash@{1} // 特定の作業
# 退避した作業を削除
$ git stash drop // 最新の作業
$ git stash drop stash@{1} // 特定の作業
# 退避した作業を全て削除
$ git stash clear