- Как обновить пароль для Git?
- 10 ответов
- Updating credentials from the macOS Keychain
- jonjack / add-update-github-access-token-on-mac.md
- This comment has been minimized.
- neilsy commented Dec 9, 2019
- This comment has been minimized.
- mickod commented Dec 27, 2020
- This comment has been minimized.
- maximivanov commented Jan 15, 2021
- This comment has been minimized.
- colvint commented Feb 3, 2021
- This comment has been minimized.
- SimonGolms commented Feb 21, 2021
- This comment has been minimized.
- jondhill333 commented Mar 11, 2021
- This comment has been minimized.
- frisbiesa commented Mar 15, 2021
- This comment has been minimized.
- startakovsky commented Apr 21, 2021
- This comment has been minimized.
- benslack19 commented May 19, 2021 •
- This comment has been minimized.
- Archaeo-Programmer commented May 24, 2021
- This comment has been minimized.
- WANGJIEKE commented Jun 29, 2021 •
- This comment has been minimized.
- terryjray commented Jun 30, 2021
- This comment has been minimized.
- lucidlive commented Jun 30, 2021
- This comment has been minimized.
- binDongKim commented Jul 28, 2021
- This comment has been minimized.
- tresf commented Jul 28, 2021 •
- This comment has been minimized.
- piratebroadcast commented Aug 17, 2021
Как обновить пароль для Git?
Я использую BitBucket с Xcode и Git для контроля версий, и недавно я изменил все свои пароли ( спасибо Adobe!).
неудивительно, что я больше не могу нажимать свои локальные коммиты в свой репозиторий на BitBucket ( Authentication failed for ‘https://______.git’ ), но я забываю, как обновить кэшированный пароль на моем iMac. Почему-то я не смог найти его в Google или Stack Overflow, хотя мне кажется, что это должно быть довольно просто.
10 ответов
чтобы исправить это, вы можете использовать
затем вам снова будет предложено ввести пароль.
для Windows это та же команда с другим аргументом:
ни один из других ответов не работал для меня на MacOS Sierra 10.12.4
вот что я должен был сделать:
затем запустите команду git (ex. git push) и повторно введите свое имя пользователя и пароль.
У меня была та же проблема, и принятый ответ не помог мне, потому что пароль не был сохранен в связке ключей. Я набрал:
затем консоль попросила у меня новый пароль.
единственный способ изменить пароль git-это перейти в Диспетчер учетных данных в Windows (ключ Windows + тип «учетные данные») и отредактировать запись git под универсальными учетными данными Windows. Примечание: не указан в алфавитном порядке
в Windows 10 с Git
удалить / обновить связанные учетные данные, хранящиеся в учетных данных Windows в > > Панель управления\все элементы панели управления\Диспетчер учетных данных
я толкаю в хранилище в первый раз. Так нет HEAD определены.
самым простым способом было бы:
затем он запросит пароль, и как только вы введете его, он будет сохранен автоматически, и вы сможете нажать.
Если вы пользователь MAC, то вы можете открыть приложение KeyChain Access из finder, а затем искать свою учетную запись, указанную там. Просто нажмите на него и обновите пароль. Теперь попробуйте, и все встанет на свои места.
работал для меня. 🙂
в windows 10 в упомянутом выше @Imran Javed вы можете найти общие учетные данные по адресу:
Панель Управления\Все Элементы Панели Управления\Диспетчер Учетных Данных —> Учетные Данные Windows
для вашего сервера git, а затем вы можете обновить пароль, нажав кнопку Изменить.
пробовал все, но ничего не получалось. Затем сработало следующее.
- перед любым из вышеуказанных шагов, замок и разблокировать брелок снова, потому что иногда он вроде застревает.
- установите рабочий стол GitHub-это помогает.
Я бы попытался удалить свою учетную запись в Keychain Access, а затем запустить git clone снова. Git попросит у меня новый пароль.
Источник
Updating credentials from the macOS Keychain
You’ll need to update your saved credentials in the git-credential-osxkeychain helper if you change your username, password, or personal access token on GitHub.
Note: Updating credentials from the macOS Keychain only applies to users who manually configured a PAT using the osxkeychain helper that is built-in to macOS.
We recommend you either configure SSH or upgrade to the Git Credential Manager Core (GCM Core) instead. GCM Core can manage authentication on your behalf (no more manual PATs) including 2FA (two-factor auth).
When Git prompts you for your password, enter your personal access token (PAT) instead. Password-based authentication for Git has been removed, and using a PAT is more secure. For more information, see «Creating a personal access token.»
Updating your credentials via Keychain Access
- Click on the Spotlight icon (magnifying glass) on the right side of the menu bar. Type Keychain access then press the Enter key to launch the app.
- In Keychain Access, search for github.com.
- Find the «internet password» entry for github.com .
- Edit or delete the entry accordingly.
Deleting your credentials via the command line
Through the command line, you can use the credential helper directly to erase the keychain entry.
If it’s successful, nothing will print out. To test that it works, try and clone a private repository from GitHub. If you are prompted for a password, the keychain entry was deleted.
Источник
jonjack / add-update-github-access-token-on-mac.md
As outlined here, there are a couple of situations where you may want/need to authenticate with GitHub by using an Access Token:-
- If you have Two-Factor Authentication (2FA) enabled.
- You are accessing an organisations protected content using SAML Single-Sign On (SSO).
Using an Access Token for the first time
Create an Access Token
In your GitHub account, go to Settings / Developer settings / Personal access tokens and select Generate New Token . Make a note of the token somewhere safe since this is the only chance you get to see it.
Add the token to your OSX Key Chain
When you next clone a private repository on the command line Github should challenge you for your credentials. Even though it will prompt you for your Password for ‘https://username@github.com’: this is actually where you should supply your new access token.
Using the token on your Mac the first time should automatically add it to your OSX Key Chain so that you do not need to enter it every time you are interracting with the Github API. If you check your local git configuration you should see that there is a credential.helper key pointing to the OSX Key Chain.
Updating to a new Access Token
If you need to regenerate the Access Token then log into your Github dashboard and navigate to Settings / Developer settings / Personal access tokens and choose to either Generate new token or replace your existing token, either by choosing Delete and Generate new token , or viewing your current token and choosing Regenerate token .
Remove existing token from your Keychain
The general approach described in the Github documentation is to use the following git command to erase your local credentials.
Note, it is worth reading the rest of this section before running the following command.
The above would appear to be increasingly ineffective and, as many report in the comments below, often just hangs. An alternative approach to deleting the existing token is to try the following command.
If you had a token previously stored then running the above should output something like the following.
Now, the next time you attempt a clone/pull/push etc on a private repo, the Github API should prompt you for your Username/Password. Note that you enter your new token when prompted for Password.
The new token should get added to your local Key Chain so you should not need to specify it again until the next time you decide/need to regenerate a new one.
To check if your access token exists in your keychain
To check if the token still exists you can try this.
Which should report something like this if it exists.
Or else if it does not exist then you should see something like this.
This comment has been minimized.
Copy link Quote reply
neilsy commented Dec 9, 2019
I had to change access method, from login/password to token access. But trying to delete the existing credential, I found that ‘git credential-osxkeychain erase’ seemed to hang for me (on OS X 10.14.6). I was able to delete the credential in the Keychain Access app without any problem. After that, running ‘git pull’ prompted me for new credentials
This comment has been minimized.
Copy link Quote reply
mickod commented Dec 27, 2020
Deleting from the KeyChain Access App worked fine — one note is that there will likely be multiple entries for GitHub.com and it is the «internet password» entry for github.com that you want to delete.
If you are worried about deleting a key you can’t recover again by mistake, you can copy the existing key from keychain access by right clicking it also — with all the usual caveats that as soon as you save it someplace you need to be very careful to fully delete it afterwards if you don’t want a copy of it.
This comment has been minimized.
Copy link Quote reply
maximivanov commented Jan 15, 2021
Fresh Big Sur 11.1 install. I want to remove a Github token from the keychain.
git credential-osxkeychain erase hangs.
I can see a github.com entry in the Keychain Access UI, but I cannot remove it.
If I filter for that entry with search box, right-click and Delete «github.com» does nothing.
If I clear the filter and find the entry in the list, Delete option is not available in the context menu.
I ended up using a command line tool to remove the token from the keychain:
security delete-internet-password -l github.com
(You may want to use security find-internet-password —help to find the entry first.)
This comment has been minimized.
Copy link Quote reply
colvint commented Feb 3, 2021
Also fresh Big Sur 11.1 install here.
ssh -T git@github.com
Did the trick for me.
This comment has been minimized.
Copy link Quote reply
SimonGolms commented Feb 21, 2021
After typing git credential-osxkeychain erase the display does not hang/load, instead it expects another input, see: https://stackoverflow.com/a/28007050
This comment has been minimized.
Copy link Quote reply
jondhill333 commented Mar 11, 2021
Yep, the above works, it just appears like its done nothing. However just go to push to Github again and you will see it asks for authorisation and it should be all working.
This comment has been minimized.
Copy link Quote reply
frisbiesa commented Mar 15, 2021
I deleted the token from the keychain but I’m still not being prompted for my new api password. Super frustrating.
This comment has been minimized.
Copy link Quote reply
startakovsky commented Apr 21, 2021
Same. This string of comments didn’t help / weren’t intuitive to me. Going to manually manipulate git config.
This comment has been minimized.
Copy link Quote reply
benslack19 commented May 19, 2021 •
This was much more frustrating than I expected as well but got it to eventually work. I’m on MacOS Catalina. Here were my steps:
- I deleted within the Keychain Access app based on this GitHub page.
- It wouldn’t prompt me for a password after a git push or a git clone of a private repo.
- I then tried git credential-osxkeychain erase but it hangs.
- I tried git config —global credential.helper osxkeychain , which was taken from [here].(https://gist.github.com/nepsilon/0fd0c779f76d7172f12477ba9d71bb66).
- I then re-started my computer.
- It worked after the re-boot.
This comment has been minimized.
Copy link Quote reply
Archaeo-Programmer commented May 24, 2021
My solution ended up being much simpler than the suggestions above (at least for macOS Mojave version 10.14.6). After following the instructions above to generate/re-generate (I had to regenerate a token due to the new authentication token formats), I tried the following:
- I did git pull with the hopes of being prompted to update my password. But it just said that the password failed.
- I tried looking into keychain access, but nothing came up when searching for git / GitHub
- I then tried git credential-osxkeychain erase , but mine also hangs.
- I then simply quit the terminal, then opened it back up and went to my git directory, did git pull again and then it prompted me for my user name and password.
This comment has been minimized.
Copy link Quote reply
WANGJIEKE commented Jun 29, 2021 •
My solution consists this step
After typing git credential-osxkeychain erase the display does not hang/load, instead it expects another input, see: https://stackoverflow.com/a/28007050
and then a git config —global credential.helper osxkeychain (though this step may be unnecessary), then finally a git pull on an existed repository.
This comment has been minimized.
Copy link Quote reply
terryjray commented Jun 30, 2021
Using the ‘git credential-osxkeychain erase’ method above with the host and protocol options did work for repos that I could delete and reclone. The big issue for me was that I had a local commit that I needed to push when github decided to finally stop allowing passwords. None of the steps above allowed me to push my local commit to remote. The only thing I could do was manually edit the .git/config in my repo and manually replace my old password with the token. That did the trick but I think having to do this is ugly and hacky and I wish it wasn’t necessary 🙁
This comment has been minimized.
Copy link Quote reply
lucidlive commented Jun 30, 2021
Fresh Big Sur 11.1 install. I want to remove a Github token from the keychain.
git credential-osxkeychain erase hangs.
I can see a github.com entry in the Keychain Access UI, but I cannot remove it.
If I filter for that entry with search box, right-click and Delete «github.com» does nothing.
If I clear the filter and find the entry in the list, Delete option is not available in the context menu.
I ended up using a command line tool to remove the token from the keychain:
security delete-internet-password -l github.com
(You may want to use security find-internet-password —help to find the entry first.)
Thanks, same issue and this worked for me
This comment has been minimized.
Copy link Quote reply
binDongKim commented Jul 28, 2021
$ git credential-osxkeychain erase ⏎
host=github.com ⏎
protocol=https ⏎
⏎
⏎
This worked for me. The tricky / essential part is the «enter» key. You need to keep entering the enter key in each line.
After this, when you try any git command such as git push, the new configuration setting will be prompted.
This comment has been minimized.
Copy link Quote reply
tresf commented Jul 28, 2021 •
The lower paragraph uses the words «prompt you for your token». I would recommend it’s changed to match the paragraph above which specifically states «prompt you for your Password» to match. Also, the paragraph above might have a missing _ after the word password.
This comment has been minimized.
Copy link Quote reply
piratebroadcast commented Aug 17, 2021
$ git credential-osxkeychain erase ⏎
host=github.com ⏎
protocol=https ⏎
⏎
⏎
This worked for me. The tricky / essential part is the «enter» key. You need to keep entering the enter key in each line.
After this, when you try any git command such as git push, the new configuration setting will be prompted.
For anyone searching, this is the correct solution.
Источник