git - What is a 'temporary clone token' (in GitHub)
问题描述
I'm using GitHub Classroom to manage student assignments through GitHub. The basic workflow is that I create an assignment (including a starter repo), the students fork the repo on GitHub, clone it to their computers, then commit/push their changes back to GitHub.
I'd like to modify their repos and push my changes (technically I just want to add a file with feedback, not change their code, but that's neither here nor there).
When I try to push the changes back to GitHub I get the following error:
remote: Temporary clone tokens are read-only.
fatal: unable to access 'https://github.com/2019-BIT-142/bit-142-lesson-10-StudentsName.git/': The requested URL returned error: 403
What is a 'temporary clone token'? Why am I getting a 403 (forbidden) response?
I even wiped out my GitHub credentials (I'm using the Windows Credential Manager) and it's not even asking me for my username / password, so I'm assuming it's a problem with the 'clone token' itself, not my account.
解决方案
That feature comes from the project education/classroom
.
education/classroom
issue 2182 includes:
Unfortunately, this is a known limitation of Classroom Assistant since we use a temporary token to clone the repository from GitHub (we decided to do this so that Classroom Assistant wouldn't have to be its own OAuth app).
The workaround right now is to either clone the assignment again (since the tokens would be refreshed) or manually replace the URL in the repositories to remove the temporary token.
This process and the feature request, in general, are outlined in education/classroom-assistant#103.
That PR states:
The token for a repository downloaded with Classroom Assistant expires rather fast, which means I can download all repos for an assignment, but if a student makes any changes (for example if I tell them to make changes), I have to download their repo again, because the token has expired. I cannot pull their changes.
There are scripts dedicated to leave feedbacks: NNHSComputerScience/gitHubScripts
That said, I'm not sure if this is still my preferred approach to providing feedback to students. We are currently exploring using GitHub Issues instead.
I agree that committing to the repo is not the most ideal way to give feedback. I've had this idea for a long time that the feedback should come in the form of a code review on GitHub.
推荐阅读
- python-requests - 使用twill和python3.6下载文件
- c++ - 类模板实例化或表达式中的内联(“单行”)函数定义
- html - 可以为元素添加淡入淡出动画使元素闪烁吗?
- javascript - 通过 express.js 中的 res.render() 传递函数并从 pug 文件中访问该函数
- google-apps-script - 无法取消链接表单 Google 应用脚本“错误:无法删除表单的目的地。请稍候,然后重试。”
- android - 在 TextFormField 中检测新行 - Flutter
- function - Google表格中查询功能中的可选值
- css - 如何在键盘可访问性焦点上关闭汉堡菜单
- r - prcomp R 基函数中的主动变量和补充变量
- python - 给定像素 (x,y) 位置返回 (row, column) 元组