When binder launches from a github branch, it gets the correct data for that branch. If you launch a Terminal window, git does not reflect that.
git branch
* master
In my example, I used the development branch. I expected git branch to report "development".
See bug description, above.
This is the contents of README.md in my development branch:
Test of using branch in binder
git branchNot relevant
bash
jupyterhub --version
1.1.0
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.

You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:
Could this be because both development and master are the same commit 815012fb283e933b1a56bc8b777abbd3df5ee234? What happens if you add a commit to your development branch and then start a new binder?
edit: they aren't the same commit.
Need to think about why/how git branch shows "the wrong" branch name.
I wonder if it's related to
Does anyone remember why we do such "weird" things on checkout instead of a more standard workflow?
It's to do with submodules
According to https://github.com/jupyterhub/nbgitpuller/issues/142 it's possible to set the upstream git branch after cloning which might resolve this issue.
Most helpful comment
I wonder if it's related to
--no-checkouthttps://github.com/jupyter/repo2docker/blob/8bbced7ded5a21b581f1f3846ffc9f87944ba799/repo2docker/contentproviders/git.py#L31git reset --hardhttps://github.com/jupyter/repo2docker/blob/8bbced7ded5a21b581f1f3846ffc9f87944ba799/repo2docker/contentproviders/git.py#L55