質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.49%
Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

GitHub

GitHubは、Gitバージョン管理システムを利用したソフトウェア開発向けの共有ウェブサービスです。GitHub商用プランおよびオープンソースプロジェクト向けの無料アカウントを提供しています。

Q&A

解決済

2回答

5656閲覧

消したはずのファイルが原因でpushできない

kaoru-drosera

総合スコア23

Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

GitHub

GitHubは、Gitバージョン管理システムを利用したソフトウェア開発向けの共有ウェブサービスです。GitHub商用プランおよびオープンソースプロジェクト向けの無料アカウントを提供しています。

0グッド

0クリップ

投稿2018/12/12 06:12

前提・実現したいこと

githubを利用していたのですが、容量が重くて消したはずのファイルが原因で何度やってもpushがうまくいきません。
githubに、ファイルをpushしようとしていた時のことです。

発生している問題・エラーメッセージ

エラーメッセージ

該当のソースコード

github

1 2remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com. 3remote: error: Trace: 19d4a5330b541f51497deac7cc20459c 4remote: error: See http://git.io/iEPt8g for more information. 5remote: error: File wireframe/見取り図.ai is 106.08 MB; this exceeds GitHub's file size limit of 100.00 MB 6To https://github.com/kaoru-drosera/LP_rep4.kari.git 7 ! [remote rejected] master -> master (pre-receive hook declined) 8error: failed to push some refs to 'https://github.com/kaoru-drosera/LP_rep4.kari.git' 9 10

試したこと

原因のファイルは「見取り図.ai」というai.(illustrator)のファイルです。元々はある状態でpushを試みたのですが、失敗したので原因のファイルをゴミ箱に入れて空にして完全に削除しました。
その後、原因のファイルが入っていたファイルごと消してみました。

pushはそれでも上手くいっていません。errorを確認してみると、どうやらどこかに原因のファイルが残ってしまっているようです。
ファイル削除後、git add --allも試してみたのですが、まだ残ってしまっているようです。

git rmも試してみたのですが、原因のファイルがあったフォルダの階層に行って消そうとしても失敗してしまいます。
ちなみに、git rmを試した時のエラーコードがこちらです。

github

1 2tiojinbouchou-no-iMac-2:サンプルページ模写_kari tiojinbouchou$ cd wireframe 3tiojinbouchou-no-iMac-2:wireframe tiojinbouchou$ git rm 見取り図.ai 4fatal: pathspec '見取り図.ai' did not match any files 5

補足情報(FW/ツールのバージョンなど)

使用環境はmacターミナル2.6.2です。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答2

0

ベストアンサー

単純にgitの管理から外したいなら

git rm --cached [ファイル名]

が使えると思います。
こちらで対処できない場合はこちらが参考になると思います。
https://qiita.com/kanaya/items/ad52f25da32cb5aa19e6

投稿2018/12/12 07:00

intelf___

総合スコア868

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

kaoru-drosera

2018/12/12 08:23

ご回答ありがとうございます! ただし、まずはファイルサイズを縮小してから試してみます。
kaoru-drosera

2018/12/13 02:17

git rm -cachedを使おうとしてもなぜかターミナルが落ちてしまい、諦めてgit LFSをダウンロードしようとしましたが、Homevrewをダウンロードする段階で挫折してしまっています。 具体的には、パスワードの入力を求められる段階で詰まっています。作業しているPCにはパスワードが設定されていないため何を入力していいかわからないのです。 結局、pushしたいフォルダのコピーとそのローカルレポジトリを作ることで、原因の「'見取り図.ai'」が消えた状態のレポジトリとしてpushすることに成功しました。 せっかくいただいた回答を役立てることができず、大変申し訳ありません。
kaoru-drosera

2018/12/13 02:19

Homevrewをダウンロードしようとした際のコードを貼っておきます。 、、、github tiojinbouchou-no-iMac-2:サンプルページ模写_kari tiojinbouchou$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ==> You are using macOS 10.11. ==> We (and Apple) do not provide support for this old version. This installation may not succeed. After installation, you will encounter build failures and other breakages. Please create pull requests instead of asking for help on Homebrew's GitHub, Discourse, Twitter or IRC. As you are running this old version, you are responsible for resolving any issues you experience. ==> This script will install: /usr/local/bin/brew /usr/local/share/doc/homebrew /usr/local/share/man/man1/brew.1 /usr/local/share/zsh/site-functions/_brew /usr/local/etc/bash_completion.d/brew /usr/local/Homebrew ==> The following existing directories will be made group writable: /usr/local/bin /usr/local/share /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7 ==> The following existing directories will have their owner set to tiojinbouchou: /usr/local/bin /usr/local/share /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7 ==> The following existing directories will have their group set to admin: /usr/local/bin /usr/local/share /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7 ==> The following new directories will be created: /usr/local/etc /usr/local/include /usr/local/lib /usr/local/sbin /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks Press RETURN to continue or any other key to abort ==> /usr/bin/sudo /bin/chmod u+rwx /usr/local/bin /usr/local/share /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7 WARNING: Improper use of the sudo command could lead to data loss or the deletion of important system files. Please double-check your typing when using sudo. Type "man sudo" for more information. To proceed, enter your password, or type Ctrl-C to abort. Password: Sorry, try again. Password: Sorry, try again. Password: Sorry, try again. sudo: 3 incorrect password attempts Failed during: /usr/bin/sudo /bin/chmod u+rwx /usr/local/bin /usr/local/share /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7 tiojinbouchou-no-iMac-2:サンプルページ模写_kari tiojinbouchou$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ==> You are using macOS 10.11. ==> We (and Apple) do not provide support for this old version. This installation may not succeed. After installation, you will encounter build failures and other breakages. Please create pull requests instead of asking for help on Homebrew's GitHub, Discourse, Twitter or IRC. As you are running this old version, you are responsible for resolving any issues you experience. ==> This script will install: /usr/local/bin/brew /usr/local/share/doc/homebrew /usr/local/share/man/man1/brew.1 /usr/local/share/zsh/site-functions/_brew /usr/local/etc/bash_completion.d/brew /usr/local/Homebrew ==> The following existing directories will be made group writable: /usr/local/bin /usr/local/share /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7 ==> The following existing directories will have their owner set to tiojinbouchou: /usr/local/bin /usr/local/share /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7 ==> The following existing directories will have their group set to admin: /usr/local/bin /usr/local/share /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7 ==> The following new directories will be created: /usr/local/etc /usr/local/include /usr/local/lib /usr/local/sbin /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks Press RETURN to continue or any other key to abort ==> /usr/bin/sudo /bin/chmod u+rwx /usr/local/bin /usr/local/share /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7 WARNING: Improper use of the sudo command could lead to data loss or the deletion of important system files. Please double-check your typing when using sudo. Type "man sudo" for more information. To proceed, enter your password, or type Ctrl-C to abort. Password: -e:72:in `system': Interrupt from -e:72:in `system' from -e:78:in `sudo' from -e:297:in `<main>' tiojinbouchou-no-iMac-2:サンプルページ模写_kari tiojinbouchou$ brew doctor -bash: brew: command not found 、、、
guest

0

単にPushしようとしているファイル(wireframe/見取り図.ai)が、100MBというGitHubの ファイルサイズ上限を超えた大きさ(106.08 MB)なので、ダメだったのでは?

見取り図.aiを編集して100MB未満のファイルに変更してから、同じ操作をしてみてください。
たぶん、素直にPushできると思います。
なぜなら、ファイルサイズ上限を超えているという問題が起きないから。

投稿2018/12/12 06:57

coco_bauer

総合スコア6915

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

kaoru-drosera

2018/12/12 08:23

ご回答ありがとうございます! まずはこの方法から試してみます。
kaoru-drosera

2018/12/13 02:26 編集

申し訳ありません。 言い忘れていたのですが、原因のファイルはゴミ箱に入れて完全に削除してしまっているので、illustratorから編集しようにもできない状態でした。 その後、 ①git rm --cacedを使って原因のファイルを消す(使おうとするとなぜかターミナルが落ちるので断念) ②git LSFをダウンロードして大容量ファイルとしてpushする(git LSFをダウンロードするのに必要な「Homevrew」をダウンロードする段階で詰まった) の2つの方法を試してみましたが結局うまくいきませんでした。 最終的に、pushするフォルダのコピーを作り、100MB以上のファイル「見取り図.ai」を消去した状態でローカルリポジトリを作り、commitを済ませたことでようやくpushに成功しました。 せっかくいただいた回答を役立てることができず、大変申し訳ありません。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.49%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問