mrjones2014 / smart-splits.nvim

🧠 Smart, seamless, directional navigation and resizing of Neovim + terminal multiplexer splits. Supports tmux, Wezterm, and Kitty. Think about splits in terms of "up/down/left/right".
MIT License
977 stars 43 forks source link

Big .git folder(48M) cause PackerSync failed when network is slow #29

Closed HenryC-3 closed 2 years ago

HenryC-3 commented 2 years ago

It would be better to remove those big files from the previous commit.

I discover this due to my poor network speed 😂.

Steps to reproduce

run du -h smart-splits.nvim/

4.0K    ../smart-splits.nvim//plugin
 24K    ../smart-splits.nvim//lua/smart-splits
 24K    ../smart-splits.nvim//lua
 48M    ../smart-splits.nvim//.git/objects/pack
  0B    ../smart-splits.nvim//.git/objects/info
 48M    ../smart-splits.nvim//.git/objects
4.0K    ../smart-splits.nvim//.git/info
4.0K    ../smart-splits.nvim//.git/logs/refs/heads
4.0K    ../smart-splits.nvim//.git/logs/refs/remotes/origin
4.0K    ../smart-splits.nvim//.git/logs/refs/remotes
8.0K    ../smart-splits.nvim//.git/logs/refs
 12K    ../smart-splits.nvim//.git/logs
 60K    ../smart-splits.nvim//.git/hooks
4.0K    ../smart-splits.nvim//.git/refs/heads
  0B    ../smart-splits.nvim//.git/refs/tags
4.0K    ../smart-splits.nvim//.git/refs/remotes/origin
4.0K    ../smart-splits.nvim//.git/refs/remotes
8.0K    ../smart-splits.nvim//.git/refs
 48M    ../smart-splits.nvim//.git
 48M    ../smart-splits.nvim/
mrjones2014 commented 2 years ago

removed demo.gif from git history, this should be a lot better now.

HenryC-3 commented 2 years ago

I tested the latest repo and found out the size still remains 48M.

I suggest following the guide at BFG Repo-Cleaner by rtyley to clean up those big files, or you can follow steps below

  1. download bfg.jar
  2. run the script
    # remove file size larger than 10M
    java -jar bfg.jar --strip-blobs-bigger-than 10M smart-splits.nvim/.git
  3. in the project directory, run
    git reflog expire --expire=now --all && git gc --prune=now --aggressive; 

    final size

    ❯ du -h .
    4.0K    ./plugin
    24K    ./lua/smart-splits
    24K    ./lua
    64K    ./.git/objects/pack
    12K    ./.git/objects/info
    84K    ./.git/objects
    8.0K    ./.git/info
    0B    ./.git/logs/refs/heads
    0B    ./.git/logs/refs/remotes/origin
    0B    ./.git/logs/refs/remotes
    0B    ./.git/logs/refs
    0B    ./.git/logs
    60K    ./.git/hooks
    0B    ./.git/refs/heads
    0B    ./.git/refs/tags
    4.0K    ./.git/refs/remotes/origin
    4.0K    ./.git/refs/remotes
    4.0K    ./.git/refs
    176K    ./.git
    220K    .
mrjones2014 commented 2 years ago

did you do a fresh clone? the whole repo is 176k for me now.

HenryC-3 commented 2 years ago

Does fresh clone just means use git clone again? If so, yes, here's my git clone output

git clone git@github.com:mrjones2014/smart-splits.nvim.git
Cloning into 'smart-splits.nvim'...
remote: Enumerating objects: 423, done.
remote: Counting objects: 100% (157/157), done.
remote: Compressing objects: 100% (93/93), done.
remote: Total 423 (delta 51), reused 157 (delta 51), pack-reused 266
Receiving objects: 100% (423/423), 47.32 MiB | 3.67 MiB/s, done.
Resolving deltas: 100% (154/154), done.
mrjones2014 commented 2 years ago

it's 168K for me when installed via packer 🤔