LoginSignup
4
7

More than 5 years have passed since last update.

【Git】 .gitignoreに設定しているファイルがリモートに存在するエラーの解決法

Last updated at Posted at 2014-12-05

git pullgit fetchをした際に、.gitignoreに設定しているファイルがリモート側に存在している場合に

error: The following untracked working tree files would be overwritten by merge:

というエラーを吐き出します。

error.png

解決策

そういった場合の解決策は、一度最新のリモートを取得し、リセットすると解決できます。

// 最新を取得
git fetch origin
// リセットする
git reset --hard FETCH_HEAD
4
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
7