If I use a submodule A in my project B, will I always have github access to the commit in A that the submodule references?
I know that for a local git repository if I were to delete the branch in A that B refers to, at some point those commits will be garbage collected.
Will github always keep this commit around even if the branch in A is deleted, due to the submodule reference?
If not, would the commit be recoverable as long as there is a pull request associated with it?
If neither of the above are the case, how long will it be until that commit becomes invalid?
Commits can be garbage collected at the request of a repository owner or administrator. Pull requests, as they're currently implemented, create an implicit branch separate from the one they're based upon. But this is undocumented functionality that is not guaranteed to always be the case and may change at any time. So if you want to be absolutely certain that the commits you care about will stick around, then you'll need to keep a branch that refers to them (or a descendant of them).
I hope that helps!