2
1

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.

githubにファイルサイズを直してもremote rejectされ続けた時の対処法

Posted at

エラー

$ git pushGithubでは100MB以上は容量オーバーだよ! て言われた.
該当ファイルを削除しても,エラーが消えなくて困った.

terminal
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: {commit-id-1}
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File {ファイルパス} is {大きい} MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/{リポジトリ}.git
 ! [remote rejected] {ブランチ} -> {ブランチ} (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/{リポジトリ}.git'

対処法

commit-id というのかわからないが,それを使って重量オーバーなファイルをコミットする前の状態に戻す.
ステージングは変更されないのでご安心を.
その後,add/commitし直せばpushができるようになる.

terminal
$ git log
...
commit {commit-id-0} (xxx)
Author: {ooo}
Date:   {日付}
...
$ git reset {commit-id-0}
2
1
2

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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?