0

I'm migrating a repo from BitBucket to GitHub with this script:

git clone --mirror git@bitbucket.org:my-username/my-project.git my-project
cd my-project
git remote remove origin
hub create --private my-username/my-project
git remote add origin git@github.com:my-username/my-project.git
git branch --set-upstream-to origin/master
git push --all --follow-tags

Note: hub is a CLI by GitHub

The last command from script above gave me this error:

Enumerating objects: 74049, done.
Counting objects: 100% (74049/74049), done.
Delta compression using up to 4 threads
Compressing objects: 100% (16940/16940), done.
Writing objects: 100% (74049/74049), 191.91 MiB | 2.22 MiB/s, done.
Total 74049 (delta 56351), reused 74047 (delta 56351)
remote: Resolving deltas: 100% (56351/56351), done.
remote: warning: File dsf_calculations_28th_july.csv is 69.58 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File dsf_calculations_28th_july.csv is 66.19 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File latest.dump.2 is 52.05 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: 466e8ca5e957b77cb35f49d1a94a040b
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File test_18490 is 417.38 MB; this exceeds GitHub's file size limit of 100.00 MB

When I cd into the cloned repository in my local machine, I couldn't find the test_18490 file. I think this file was pushed to BitBucket long time ago in an old Git commit and I don't know the commit hash.

Questions

  1. How to find that test_18490 file in my-project and delete it?
  2. If I delete the test_18490 file, will it change/delete the commit too?
  3. Will the file deletion rewrite all commit hashes between the commit that has the test_18490 file and the last commit in the repository?
Zulhilmi Zainudin
  • 9,017
  • 12
  • 62
  • 98
  • Changing a commit in the git history adheres to the functional programmers immutability—it actually creates a brand new, slightly different commit. Now, further note that part of a commit is the previous commit hash. So updating a single commit, but keeping the rest of the history, in fact creates an entirely new series of commits! In practice this is fine, but remember that push -force is best avoided with public historu – D. Ben Knoble Jan 12 '20 at 04:26
  • To find the commit : **git rev-list -n 1 HEAD -- ** If the file is already deleted you can't delete it again? Question#2 seems irrelevant in this scenario. Instead just change the [github-limit](https://help.github.com/en/enterprise/2.14/admin/installation/setting-git-push-limits) to avoid rewriting history – ankidaemon Jan 12 '20 at 07:06
  • Does this answer your question? [How to remove/delete a large file from commit history in Git repository?](https://stackoverflow.com/questions/2100907/how-to-remove-delete-a-large-file-from-commit-history-in-git-repository) – phd Jan 12 '20 at 12:10
  • https://stackoverflow.com/search?q=%5Bgit%5D+remove+large+file+history – phd Jan 12 '20 at 12:10
  • 2. Yes, it will change the commit. 3. Yes, it will rewrite all newer commits. – phd Jan 12 '20 at 12:11

0 Answers0