概要
gitのローカルリポジトリでいらないファイル類を削除したあとにgit add *
してcommit
してpush
しようとしたら以下のようなエラーがでました。
warning: You ran 'git add' with neither '-A (--all)' or '--ignore-removal', whose behaviour will change in Git 2.0 with respect to paths you removed. Paths like 'hosts/wrap-ansible-playbook' that are removed from your working tree are ignored with this version of Git. * 'git add --ignore-removal <pathspec>', which is the current default, ignores paths you removed from your working tree. * 'git add --all <pathspec>' will let you also record the removals. Run 'git status' to check the paths you removed from your working tree.
解決方法
git add -A
を実行するとよい。
git add -A
では新規/編集/削除したファイルすべての情報をリポジトリに反映してくれます。
おわりに
エラーメッセージを和訳するとこのブログよりくわしい情報が手に入るよ。
わかばちゃんと学ぶ Git使い方入門〈GitHub、Bitbucket、SourceTree〉
- 作者: 湊川あい,DQNEO
- 出版社/メーカー: シーアンドアール研究所
- 発売日: 2017/04/21
- メディア: 単行本(ソフトカバー)
- この商品を含むブログ (3件) を見る