Visual studio git сбросить пароль
Я работаю с несколькими репозиториями, но в последнее время я просто работал в нашем внутреннем, и все было здорово.
сегодня мне пришлось совершить и вставить код в другой, но у меня возникли некоторые проблемы.
Я ничего не могу сделать, чтобы снова ввести пароль.
как я могу сбросить учетные данные в моей системе, чтобы Git попросил у меня пароль этого репозитория?
для того чтобы сбросить пароль
во избежание кэширования учетных данных.
кажется, ничего не работает; у кого-нибудь есть идея получше?
кэш учетных данных Git запускает процесс демона, который кэширует ваши учетные данные в памяти и передает их по требованию. Таким образом, убийство вашего процесса git-credential-cache-daemon выбрасывает все это и приводит к повторному запросу пароля, если вы продолжаете использовать его в качестве кэша.вспомогательный вариант.
вы также можете отключить использование кэша учетных данных Git с помощью git config --global --unset credential.helper . Затем сбросьте это, и вы продолжите иметь кэшированные учетные данные, доступные для других репозитории (если есть). Вам также может потребоваться сделать git config --system --unset credential.helper если это было задано в файле конфигурации системы (например, Git для Windows 2).
В Windows вам может быть лучше использовать менеджер помощник ( git config --global credential.helper manager ). Это хранит ваши учетные данные в хранилище учетных данных Windows, который имеет интерфейс панели управления, где можно удалить или изменить сохраненные учетные данные. В этом магазине ваши данные защищены вашим логином Windows и могут сохраняться в течение нескольких проведение сессий. The менеджер помощник, включенный в Git для Windows 2.x заменил предыдущее wincred помощник, который был добавлен в Git для Windows 1.8.1.1. Подобный помощник называется магазине приложений также доступен онлайн и использовался с GitExtensions, поскольку он предлагает более управляемый интерфейс GUI. The менеджер helper предлагает тот же интерфейс GUI, что и магазине приложений.
выписка из руководство по Windows подробно Панель хранилища учетных данных Windows:
откройте учетные записи пользователей, щелкнув изображение кнопки Пуск кнопки Пуск, щелкнув Панель управления, щелкнув учетные записи пользователей и безопасность семьи (или щелкнув учетные записи пользователей, если вы подключены к сетевому домену), а затем щелкнув учетные записи пользователей. В левой области щелкните Управление учетными данными.
Если эта проблема возникает на компьютере под управлением Windows, выполните следующие действия.
- перейти к менеджеру учетных данных
- перейти к учетным данным Windows
- удалить записи в разделе Общие учетные данные
- повторите попытку подключения. На этот раз он должен запросить у вас правильное имя пользователя и пароль.
и затем вам будет предложено снова ввести свои учетные данные.
предупреждение
использование этого помощника сохранит ваши пароли незашифрованными на диске
я столкнулся с той же проблемой, что и ОП. Он принимал мои старые учетные данные Git, хранящиеся где-то в системе, и я хотел использовать Git с моими новыми учетными данными, поэтому я запустил команду
всякий раз, когда я выполнял git push это было мое старое имя пользователя, которое я установил давно, и я хотел использовать новую учетную запись GitHub для внесения изменений. Позже я обнаружил, что мои старые учетные данные учетной записи GitHub хранятся под Панель Управления → Учетные Записи Пользователей → Диспетчер Учетных Данных → Управление Учетными Данными Windows.
Я просто удалил эти учетные данные и когда я выполнил git push он попросил у меня мои учетные данные GitHub, и это сработало как шарм.
попробуйте использовать следующую команду.
здесь вы можете получить различные опции для управления учетными данными (проверьте экран ниже).
или вы даже можете напрямую попробовать этот команду:
это снова начнет запрашивать пароли для каждого запроса взаимодействия с сервером.
в моем случае Git использует Windows для хранения учетных данных.
все, что вам нужно сделать, это удалить сохраненные учетные данные, хранящиеся в вашей учетной записи Windows:
Я нашел то, что работал для меня. Когда я писал свой комментарий к OP, мне не удалось проверить файл конфигурации системы:
линии. Я снимаю его с
и теперь учетные данные будут забыты.
покажет credential.helper = manager (это на машине windows)
чтобы отключить это кэшированное имя пользователя / пароль для текущей локальной папки git, просто введите
таким образом, git будет запрашивать пароль каждый раз, игнорируя то, что сохраняется внутри "менеджер".
необходимо войти в систему с соответствующим github username и password
чтобы очистить имя пользователя и пароль в windows
Панель Управления\Учетные Записи Пользователей\Диспетчер Учетных Данных
редактировать учетные данные windows
удалите существующего пользователя и теперь перейдите в командную строку напишите команду push, она показывает всплывающее окно github для ввода username / email и password .
теперь мы можем нажать кода после переключение пользователей.
- cmdkey /list выводит список всех сохраненных учетных данных.
- cmdkey /delete:Target удаляет учетные данные с именем" Target".
(*под "wincred" я имею в виду git config --global credential.helper wincred )
удалите эту строку из вашей .файл gitconfig, расположенный в текущей папке пользователя Windows:
это сработало для меня, и теперь, когда я нажимаю на пульт, он снова запрашивает мой пароль.
Вы можете удалить строку credential.helper=!github --credentials из файла C:\Program Files\Git\mingw64\etc\gitconfig для удаления учетных данных для git
в случае диспетчер учетных данных Git для Windows используется (что обычно делают текущие версии):
Это добавлена середина 2016. Чтобы проверить, используется ли диспетчер учетных данных:
в моем случае я не смог найти учетные данные, сохраненные в Диспетчере учетных данных Windows (Windows 7).
я смог сбросить свои учетные данные, выполнив
честно говоря, это был град Марии, чтобы увидеть, если это уничтожит мои учетные данные, и это действительно сработало.
I am having a very weird situation when cloning a Git repository from our company private server. The repository is not anonymous (it requires authentication), but when cloning, VS didn't ask any username and password and automatically use an old authentication of old employee. Is there a way to remove the saved username and password and make Visual Studio to prompt them when cloning?
3 Answers 3
Under Windows 10 use rundll32.exe keymgr.dll,KRShowKeyMgr to open this regardless of the language in the OS.
I don't have any credentials in my credentials manager! Visual Studio does not prompt me for credentials and tells me it cannot access the repository
As mentioned in my comment above, I didn't have any credentials to delete on my credentials manager. What did the trick in my case was deleting the .gitconfig file, altogether (check @saastn answer)
In my case just removing credentials from Windows Credential didn't fix it. I first removed all git and azure related accounts from Windows Credential, then removed accounts from VS>Files>Account Settings, and then VS asked me new credentials and connected to the project. But my commits were still made with the old account! Finally I found out that it was the git config:
I deleted the whole user section in that file which looks like this:
On next commit VS asked me git account information and done.
If you want to work with different accounts for different projects on same machine, read this.
I am using VS 2017 and this is how I updated my Password for TFS, using Git repository.
- From the Menu: Team -> manage Connection
- Click on Manage Connection Link -> Connect to Project
It will then open window to connect to your project, here you can update your password.
I have cloned one of my GitHub repositories with Visual Studio Code and I have made some commits. Visual Studio Code has asked me for my GitHub password when I have done on the first commit.
I have rebooted the computer and now I can make commits as before, but Visual Studio Code does not ask for my password. It seems that the password has been stored. But this computer is not my computer and I do not want that somebody else could use my account.
How can I make Visual Studio Code forget my GitHub password?
I have tried the Git command:
But Visual Studio Code still lets me commit without asking.
4 Answers 4
Check your git config credential.helper :
if it is manager , you would need to open your Windows Credential Manager and remove your credentials there.
See this answer for illustration.
Or, in command-line:
Reminder, those credentials (username/password) have nothing to do with your git config user.name / user.email .
Not sure if this is still current. When I ran git config credential.helper I received "wincred" instead of "manager". My credentials were in the windows credential manager.
Mine returns nothing, but I am still able to push without entering a password. Does VSCode have it's own credential manager?
For Ubuntu/GNOME Visual Studio Code users, the Credential Manager can be accessed by launching the "Passport and Keys" application. You can delete the Visual Studio Code/GitHub entry by clicking "Password", looking for the entry and delete.
Restart Visual Studio Code after, and it would ask you to sign into GitHub all over again.
First you need to check where the passwords are located. The credentials store or the Windows generic password.
Run this in the Visual Studio Code terminal:
Go to and delete the file C:\Users\(username)\.git-credentials or you can simply remove the @github user rows from the text file.
Then go to Windows password: Control Panel → All Control Panel Items → Credential Manager. The passwords are referenced to the GitHub label in generic.
Then log in into your GitHub account with your default browser. After that, restart Visual Studio Code. Clone from GitHub and follow the authorization steps from Visual Studio Code.
I'm using BitBucket with Xcode and Git for version control, and recently I changed all of my passwords (thanks Adobe!).
33 Answers 33
To fix this on macOS, you can use
A username and password prompt will appear with your next Git action (pull, clone, push, etc.).
For Windows, it's the same command with a different argument:
On Mac OS 10.12.2 and when I did the above - checked and double checked that I entered it correctly - and nothing happened.
@b_dubb It might not do anything until the next time you reach out (push, pull,fetch) then you will be prompted for credentials.
@user2782001 I was using the osxkeychain helper, running the mac command did nothing. I suspect that if someone was not using the helper before, changing the configuration to use the helper, it would see that a password had not been entered for that remote, it would prompt, and everything would be fine the first time. Subsequent changes of the configuration would not prompt. The answer below worked for me.
None of the other answers worked for me on MacOS Sierra 10.12.4
Here is what I had to do:
Then run your git command (ex. git push ) and reenter your username and password.
This do nothing for me on Windows. After this command I've tried to push, and it was successful, so the password is still available for git
Worked on Win10. Firstly I used command from this answer and later simply git pull - Windows popup appeared prompting for a password. Thanks!
In Windows 10 with Git
Remove/update related Credentials stored in Windows Credentials in >>Control Panel\All Control Panel Items\Credential Manager
This was indeed the way. For users that have to work with the Dutch version of the OS: credentials ---> referentiebeheer
Btw, the path for me was Control Panel\User Accounts\Credential Manager but best is to type Credential to jump right in.
My preferred method for opening anything on Windows, is to tap the Windows key and type the name of the thing in, and then press enter when it pops up in the search results. It's a lot faster and easier than navigating through explorer as suggested.
The only way I could modify my git password was to go to Credential Manager in Windows (Windows Key + type 'credential') and edit the git entry under Windows Credentials 🡒 Generic Credentials. Note: Not listed alphabetically
@Saikat and yet, many of us with the same question for windows end up finding this SO question. It's almost as if the question itself while tagged macos isn't OS specific!
I had the same problem, and the accepted answer didn't help me because the password wasn't stored in the keychain. I typed:
Then console asked me for my new password.
In windows 10 as mentioned above by @Imran Javed you can find Generic Credentials at :
Control Panel\All Control Panel Items\Credential Manager --> Windows Credentials
find your git server and than you can update password by clicking edit button.
There is no git related generic credentials on my computer while I use git commit, push, pull everyday. Then how can we update the password? Please suggest. Thanks.
If you have multiple remote repositories (Github, Bitbucket, Job, etc.)
1) run in the project directory
2) run remote git command (ie. git push or git pull)
Git will prompt you to reenter your user.name and user.password for this repository
Or you can do it globally if you have only one remote repository
If you are MAC user then you can open KeyChain Access Application from finder and then look for your account listed there. Just click on it and update your password. Now give a try and things will fall in place.
This is what worked for me! It allows us to update the password from one repo. Some of the other suggestions on this page will effect everything that git touches.
running git config --global --unset user.password followed by any git command would prompt you to enter username and password.
Well, calling the command git push (or pull) just gave me authentication error and access denied. Did not prompt me
None of the other answers worked for me on MacOS Big Sur 11.3.1
I had Two-Factor Authentication enabled on Github, this makes is so you will fail when entering your username and password even when they are correct.
Here is what I had to do:
git config --global --unset user.password
Then run your git command (ex. git push) and enter your username. For the password you need to generate a Personal Access Token.
Я использую BitBucket с Xcode и Git для контроля версий, и недавно я изменил все свои пароли ( спасибо Adobe!).
затем вам снова будет предложено ввести пароль.
для Windows это та же команда с другим аргументом:
вот что я должен был сделать:
затем запустите команду 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 попросит у меня новый пароль.
Читайте также: