Skip to content

Can I update the token of a cloned repo? #22434

Discussion options

You must be logged in to vote

The solution to my original problem is the following:

$newGitHubPAT = "ghp_..."
$newOrigin = "https://token:$newGitHubPAT@github.com/owner/repo.git"
git remote remove origin # origin is the remote repo
git remote add origin $newOrigin

Basically you just remove the old origin that referenced the remote repository with the old token and add the origin with the new PAT.

Replies: 9 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@asteve12335
Comment options

@YassineRKB
Comment options

@YassineRKB
Comment options

@airtower-luna
Comment options

Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@airtower-luna
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants