10
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

.gitignoreに後から追加したリソースをリモート上から一括削除する

Last updated at Posted at 2015-12-17

既にリモートリポジトリ上で管理されているリソースは、
後から.gitignoreに設定してもリモート上は残ったままとなる。

対象リソースが大量にある場合は以下のコマンドで一括削除できる。

git rm --cached `git ls-files -i --full-name --exclude-from=.gitignore`

その後、commit & pushすればOK。

10
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
10
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?