简体   繁体   English

在 IntelliJ IDEA、WebStorm、RubyMine 等中更改 GIT 登录名/用户名

[英]Change GIT login/username in IntelliJ IDEA, WebStorm, RubyMine etc

Authentication login/username for my GIT account changed.我的 GIT 帐户的身份验证登录名/用户名已更改。 How do I tell this to my IntelliJ product?我如何告诉我的 IntelliJ 产品?

GIT record login-name in remote repository URL. GIT 在远程存储库 URL 中记录登录名。 You can change that in IntelliJ product in couple of ways.您可以通过多种方式在 IntelliJ 产品中更改它。

Quick way快捷方式

  • Type CTRL + SHIFT + A to open Enter action or option name dialog键入CTRL + SHIFT + A打开输入操作或选项名称对话框输入操作或选项名称对话框过滤“遥控器...”
  • Type Remotes... to filter the list as in image键入Remotes...以过滤图像中的列表
  • Select Remotes... for Git (first selection on image) and following dialog is openede为 Git 选择Remotes... (图像上的第一个选择)并打开以下对话框在此处输入图片说明
  • In Git Remotes dialog, use pencil icon to open Define Remote dialogGit Remotes对话框中,使用铅笔图标打开定义远程对话框在此处输入图片说明
  • Press OK to confirm确定确认
  • Re-enter your password and optionally have IntelliJ store it.重新输入您的密码,并可选择让 IntelliJ 存储它。

Point and Click way指向和点击方式

  • Select VCS menu选择VCS菜单
  • Hover on Git menu item将鼠标悬停在Git菜单项上
  • Select from sub-menu Remotes...从子菜单中选择遥控器...
  • Continue as described above继续如上所述

Terminal way终端方式

  • Open Terminal in your IntelliJ tool ALT + F12在 IntelliJ 工具中打开终端ALT + F12
  • Enter command git ls-remotes --get-url to see your current remotes输入命令git ls-remotes --get-url以查看您当前的遥控器
  • Enter command with modified username git remotes set-url https://my_new_user@my.git.server/path/to/project.git输入带有修改过的用户名的命令git remotes set-url https://my_new_user@my.git.server/path/to/project.git

i met this problem before, and solved it by steps:我以前遇到过这个问题,并通过步骤解决了它:

  1. open terminal打开终端
  2. input git command that needs to communicate with git server, like git pull origin <your branch>输入需要与git服务器通信的git命令,如git pull origin <your branch>
  3. input username and password ( because the stored password by idea can't be authorized, so the server will ask you to input username and password)输入用户名和密码(因为idea存储的密码不能被授权,所以服务器会要求你输入用户名和密码)
  4. done.完毕。 (idea will update the password to the user) (idea 会更新用户的密码)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM