7

A friend of mine has written an irc bot, and has the code on github. I made a fork, and wrote a few plugins and pushed to my fork. The owner of the original repo moved the plugins folder to a submodule (I don't even really get that, I've never really used git) and fetching and merging failed, and I couldn't figure out what went wrong.

So I deleted my fork, and forked it all over again, but when I did git clone {my github fork} I had an empty plugins folder. I'm not sure what I'm doing wrong, or what's the right way to fork a repo that has a submodule thing in it. :/

@manojlds answer below does grab the submodule and grab the stuff to put in the plugins directory, but if I try to add a file and push I can't because it's pointing at the original submodule. I've forked the submodule now too, I just don't know how to make my main repo point to my fork of the submodule instead of the upstream submodule.

1

1 Answer 1

3

You can run:

git submodule update --init --recursive

( or you can clone using the --recurse-submodules option)

and the plugins folder will be populated. If you don't understand about submodules, read about them here: http://book.git-scm.com/5_submodules.html

Sign up to request clarification or add additional context in comments.

3 Comments

If I fork the original repo, will that work on my fork? I guess I'll find out.
This doesn't quite work, my fork points to the plugins submodule from the original repo, which I can't push to.
I just made a fork of the submodule repo and push from that folder. I did find instructions elsewhere that I will be giving a shot tonight. If it works, I will add that as answer.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.