You will need to generate a new Github token and update the token in your git configuration. Here are the steps:
- Go to your Github account settings.
- Select “Developer settings” from the left sidebar.
- Click on “Personal access tokens”.
- Generate a new token with the necessary permissions for your repository.
- Copy the new token.
- In your terminal, navigate to the cloned repository and use the following command:
git config --global credential.helper store
- Use this command to remove any existing credentials stored in Git:
git credential-cache exit
- Use this command to update the Github token in Git:
git remote set-url origin https://<new-token>@github.com/<username>/<repository>.git
- Push your changes using the updated token.
Note: Make sure that you keep track of when your Github tokens expire and regenerate them before they expire to avoid any interruptions in pushing code to Github.