Classroom detached my branch in assignment repo

It was rather an awkward moment when I showed my students my new GitHub Classroom assignment. I ‘accepted’ the assignment link, cloned the ‘student’ repo, worked, and started to create a pull request to a branch I’d created a week prior on the master repo. GitHub told me that “the commit histories are entirely different.” Opening the Git GUI, my branch did indeed seem to be completely disconnected. Huh?

I think this may have been due to ‘enable feedback’ on my classroom repository. Can someone confirm?

@ADWolfe-LoyNO Hmm strange! Are you able to reproduce this in a public assignment repo that we can take a look at? It’s a bit tricky to debug this without a little more information.


how about I add you to the repo?

That also works, happy to take a look :slight_smile:

This exactly the behavior you get if you chose the template repo when you created the assignment instead of the “slower” version.

I thought this might be the case; I did mark the repo as a ‘template.’ @d12 can you verify?

Does this have anything to do with the ‘feedback’ branches?

I don’t think this is related to the feedback branches, but possibly this?

This is a change to the template feature we use that went out recently. It seems the API endpoint automatically pulls all branches, we don’t have much say in that. Is it possible for you to work around this?

I can work around it. My main worry was that I had broken something and that I might break it again in the future.
I was using branches (in a different GH classroom) for the exact same purpose as ‘feedback’ so as long as I have ‘feedback’ I’m good.
I’ve lost the link on the feedback feature, however, can you post it for me so I can be sure to use it correctly?

Glad to hear :slight_smile: You can find more info about the feedback feature here:

I’m looking deeper and I think there is an issue with template repositories in Classroom. It seems that when a template repository is instantiated, even though the branches are all there, they lose their ‘history’. Oddly the file comparisons still show up correctly, but the student cannot create a pull request because, again “the commit histories are completely different.”

It seems to me that template repositories were conceived as not having branches, and the implementation of ‘instantiate with all branches’ doesn’t really do it right. If you can’t create pull requests or merges, the branches are useless to include in the repository.

1 Like