I have a bunch of videos inside a directory named "videos". I committed that unfortunately large folder to git, causing git to become very slow for some activities such as cloning. So I did some research and discovered git submodules, but I don't seem to understand them very well.
Here's what I did:
- I created a separate repository just for the videos at ssh://dev.example.org/var/git/project/microsite_videos and put the videos in there.
- I deleted the videos from my main repo at ssh://dev.example.org/var/git/project/microsite and committed the delete. I realize this doesn't remove the videos from history, but I wanted to make sure I understood submodules before I change history.
I added the videos back as a submodule:
git submodule add ssh://dev.example.org/var/git/project/microsite_videos videos
I committed these changes to master.
Here is my .gitmodules file:
[submodule "videos"]
path = videos
url = ssh://dev.example.org/var/git/project/microsite_videos
At first it seemed to work OK, but I'm confused about some of its behavior. In particular, just now I merged master into a branch and the videos folder just disappeared. The .gitmodules file is still there, but any attempt to pull or update the videos folder just gives me a new prompt without appearing to do anything.
What am I doing wrong, and how can I improve the my understanding of submodules so I don't have to flounder every time I try to branch and merge?