Reputation: 1099
I have a git submodule (a vim plugin from github) which is already inside a git repository, and has been for 10 commits or so.
I would now like to fork the submodule repo and make my own changes.
I think this will work ... but is it a bad way to do it?
.gitmodules
file in the main repo so it points to my forked repo on githubgit submodule sync
git submodule update
Or will this lose some git history tracking information / is there a better way?
Upvotes: 1
Views: 256
Reputation: 93167
This is how you're supposed to do it (maybe except git submodule update
which in your case shouldn't do anything until you've done your own commits). You'll just have to remember to fetch from time to time changes from upstream if you want to keep your module up to date.
To do this part, just go inside your submodule, add an upstream remote toward the upstream repository and fetch upstream.
Upvotes: 3