generated from Java-2025Fall/final-vibevault-template
完成作业
This commit is contained in:
parent
6e12b6df86
commit
0115a4bf31
54
git_authentication_guide.md
Normal file
54
git_authentication_guide.md
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
# Git身份验证失败解决方案
|
||||||
|
|
||||||
|
## 问题分析
|
||||||
|
您遇到了Git push时的身份验证失败:`fatal: Authentication failed for 'http://49.234.193.192:3000/liyiantian/2311061111/'`
|
||||||
|
|
||||||
|
## 解决方案
|
||||||
|
|
||||||
|
### 方法1:检查并更新Windows凭证管理器
|
||||||
|
1. 打开控制面板:`Win + R` → 输入 `control` → 回车
|
||||||
|
2. 搜索并打开 "凭证管理器"
|
||||||
|
3. 选择 "Windows 凭证"
|
||||||
|
4. 在 "普通凭证" 中查找包含 `49.234.193.192` 或 `liyiantian` 的条目
|
||||||
|
5. 如果找到,点击 "编辑" 更新用户名和密码
|
||||||
|
6. 如果没有,点击 "添加普通凭证" 创建新条目
|
||||||
|
|
||||||
|
### 方法2:重新配置Git用户名和邮箱
|
||||||
|
在PowerShell中执行:
|
||||||
|
```powershell
|
||||||
|
# 配置全局用户名和邮箱
|
||||||
|
git config --global user.name "您的用户名"
|
||||||
|
git config --global user.email "您的邮箱"
|
||||||
|
|
||||||
|
# 检查配置
|
||||||
|
git config --list
|
||||||
|
```
|
||||||
|
|
||||||
|
### 方法3:使用Personal Access Token (PAT) 代替密码
|
||||||
|
1. 登录到您的Git服务器(http://49.234.193.192:3000)
|
||||||
|
2. 进入用户设置 → 个人访问令牌
|
||||||
|
3. 创建一个新令牌,勾选必要的权限(至少需要仓库访问权限)
|
||||||
|
4. 复制生成的令牌
|
||||||
|
5. 在PowerShell中执行:
|
||||||
|
```powershell
|
||||||
|
# 清除旧凭证
|
||||||
|
git credential-manager reject http://49.234.193.192:3000
|
||||||
|
|
||||||
|
# 重新push,输入用户名和令牌(令牌作为密码)
|
||||||
|
git push
|
||||||
|
```
|
||||||
|
|
||||||
|
### 方法4:检查远程仓库URL
|
||||||
|
```powershell
|
||||||
|
# 查看当前远程URL
|
||||||
|
git remote -v
|
||||||
|
|
||||||
|
# 如果URL不正确,更新它
|
||||||
|
git remote set-url origin http://49.234.193.192:3000/liyiantian/2311061111.git
|
||||||
|
```
|
||||||
|
|
||||||
|
## 注意事项
|
||||||
|
- 一旦push成功,由于您的提交信息包含"完成作业",自动评分会立即触发
|
||||||
|
- 您的本地代码已经包含了所有必要的更改和截图
|
||||||
|
|
||||||
|
如果以上方法都不行,建议联系系统管理员获取正确的Git访问权限。
|
||||||
Loading…
Reference in New Issue
Block a user