Submodules are often detached (and that’s okay), you want them to point at a particular commit as specified by the parent repo, not a named branch. Just pay attention to git status in the parent repo.
You don’t need to switch your upstream branch to mine as such. It can be helpful to think of a git repo as a local collection of commits that’s a subset of some larger global collection of commits. What we want to do is to ask git to bring my commits into your local repo, to do so we use the fetch subcommand (which also updates the branch names that are used in my repo).
cd teletype
# add my GitHub repo as a remote
git remote add samdoshi https://github.com/samdoshi/teletype.git
# import commits in my remote that you don't have, and update branch references
git fetch samdoshi
(git fetch <remote> will not pull in unreferenced commits.)
You need to do the same for the libavr32 submodule, as when you checkout my 2.0 branch and do a git submodule update, git will expect the libavr32 submodule to have the relevant commit stored locally.
cd libavr32
git remote add samdoshi https://github.com/samdoshi/libavr32.git
git fetch samdoshi
cd ..
Now we need to checkout a copy of my 2.0 branch
# if you want a local branch
git checkout -b telex_aliases samdoshi/2.0
# or if you only want to play with the code temporarily
git checkout samdoshi/2.0
# don't forget to update the submodule, whichever you do
git submodule update
Eventually once you’ve committed some changes, you’ll want to push to your origin…
While I’m on the subject, here are some things for your .gitconfig (or .config/git/config)
[status]
submoduleSummary = true
[url "git@github.com:"]
;; e.g git remote add gh:samdoshi/my_repo.git
;; git clone gh:samdoshi/my_repo.git
;; (git clone gh:samdoshi/my_repo also works)
insteadOf = gh:
(apologies if you know all of this already)