Closed paulsmithkc closed 4 years ago
Stop sending me email I have tried to unroll but you refuse stop now or else
Sent from Yahoo Mail on Android
On Tue, Jan 14, 2020 at 11:19 AM, Paul Smithnotifications@github.com wrote:
Describe the bug
I can use the Classroom Assistant client to download a snapshot of my students' assignments. However, when I try to pull down a new version of their assignment I get the following error.
remote: The token in this link has expired. Please request another temporary clone link.
To Reproduce Steps to reproduce the behavior:
Expected behavior Git should be able to successfully pull down the latest version of the student's code.
Screenshots
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Unscribe
Sent from Yahoo Mail on Android
On Wed, Jan 15, 2020 at 12:40 AM, womenpower19111notifications@github.com wrote: Stop sending me email I have tried to unroll but you refuse stop now or else
Sent from Yahoo Mail on Android
On Tue, Jan 14, 2020 at 11:19 AM, Paul Smithnotifications@github.com wrote: Describe the bug I can use the Classroom Assistant client to download a snapshot of my students' assignments. However, when I try to pull down a new version of their assignment I get the following error.
remote: The token in this link has expired. Please request another temporary clone link.
To Reproduce Steps to reproduce the behavior:
Expected behavior Git should be able to successfully pull down the latest version of the student's code.
Screenshots
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
@womenpower19111 You're receiving notifications because you're watching the repository, you can un-watch at the top of this page.
@paulsmithkc Thanks for the report! I spent some time digging this morning and I think I've tracked down the issue. In one of the affected repositories, if you run git remote -v
, do you see a URL that includes an access token like this?
"https://x-access-token:faketokenfaketokenfaketoken@github.com/Your-Org-Name/Assignment-User.git"
If so, we'll just need to reset your remotes to not include the x-access-token so that Git uses your local configuration to authenticate. Let me know if this is the type of URL you see and I'll put together a quickfix script that'll fix these repos until we have a proper fix in Classroom Assistant.
Yes, the remotes do follow that pattern and include an access token.
Awesome, can you try resetting the remote and seeing if it resolves the issue?
The new URL is the one you see in git remote -v, but without the x-access-token:blahblah@
.
git remote set-url origin https://github.com/your-org/your-repo-name.git
Alternatively, this one liner will fix the origin remote for you:
git remote set-url origin "https://$(git remote -v | grep "origin" | head -1 | cut -d " " -f 1 | cut -d "@" -f 2)"
Yes, that one line script does fix the remote config.
However, if applied twice it does not work. If this script is run again I get:
origin https://origin https://github.com/RankenTechnicalCollege/awd-1112-alexander-ottosson.git (fetch)
Notice the extra https://origin, because the @ sign is no longer there.
This script, which I found on another thread works better:
git remote set-url origin $(git remote -v | head -n 1 | grep -o 'github\.com.*\.git' | awk '{print "https://"$1}')
Script to do fix the origin and pull code for all my students in one go:
#!/bin/bash
pull_repo()
{
# remove access token
git remote set-url origin $(git remote -v | head -n 1 | grep -o 'github\.com.*\.git' | awk '{print "https://"$1}')
# pull latest version
git fetch origin
git merge --ff-only origin/master
}
for student in ./*
do
if [[ -d $student ]] && [[ -d "$student/.git" ]] && [[ $student != ./_* ]]
then
echo -e "\e[32m$student\e[0m"
pushd $student > /dev/null
pull_repo "$student"
popd > /dev/null
fi
done
echo
echo -e "\e[32mdone\e[0m"
#sleep 20
Describe the bug I can use the Classroom Assistant client to download a snapshot of my students' assignments. However, when I try to pull down a new version of their assignment I get the following error.
remote: The token in this link has expired. Please request another temporary clone link.
To Reproduce Steps to reproduce the behavior:
git pull
on one of the dowloaded repos.remote: The token in this link has expired. Please request another temporary clone link.
Expected behavior Git should be able to successfully pull down the latest version of the student's code.
Screenshots![git_token_expired](https://user-images.githubusercontent.com/6501079/72366238-7c487c00-36bf-11ea-84d5-175213142045.PNG)