You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The purpose of git worktree is to Manage multiple working trees attached to the same repository.
This is precisely what gvm is doing currently. Except that it uses git clone from the archive repository. Operationally, there is no difference between using git clone and git worktree, but under the hood ( of git objects ), the different versions are different copies of the same repository with multiple copies ( the number of go versions that are installed on the machine ) of the same binary git objects. git worktree simplifies the management of this and makes it easier to manage the git objects associated with the repository.
The difference of using git clone vs git worktree is the amount of storage space that is consumed. The golang source has about 200+MB of git objects that is consumed per clone of the repository. This means that if one has 5 different versions installed without any extra packages installed, then that is 1GB of storage consumed. However, using git worktree, the storage stays at ~200 MB. I saw the storage increase by ~150MB after I had installed over 15 versions ( 1.4 through 1.20 ).
Now, the interesting aspect to this ( and the main reason I am opening this issue ) is that switching from git clone to git worktree is a single line of code.
The purpose of
git worktree
is to Manage multiple working trees attached to the same repository.This is precisely what gvm is doing currently. Except that it uses
git clone
from the archive repository. Operationally, there is no difference between usinggit clone
andgit worktree
, but under the hood ( of git objects ), the different versions are different copies of the same repository with multiple copies ( the number of go versions that are installed on the machine ) of the same binary git objects.git worktree
simplifies the management of this and makes it easier to manage the git objects associated with the repository.The difference of using
git clone
vsgit worktree
is the amount of storage space that is consumed. The golang source has about 200+MB of git objects that is consumed per clone of the repository. This means that if one has 5 different versions installed without any extra packages installed, then that is 1GB of storage consumed. However, usinggit worktree
, the storage stays at ~200 MB. I saw the storage increase by ~150MB after I had installed over 15 versions ( 1.4 through 1.20 ).Now, the interesting aspect to this ( and the main reason I am opening this issue ) is that switching from
git clone
togit worktree
is a single line of code.If this seems feasible, and interesting to the project, let me know and I can open a pull request for this change.
The text was updated successfully, but these errors were encountered: