Push failed Remote: Invalid username or password. Authentication failed for ‘https://

** 在进行goland中进行代码提交的时候,发现上述错误,原因主要如下**

1. 没有在goland中进行登录github
2. 登陆过期了

在goland的中进行登录
在这里插入图片描述
在登陆的过程中,通过使用密码进行登录是会发生错误的,应该使用token进行登录

具体是在浏览器中打开github, 在setting中生成一个token进行登录即可了。

然后进行push即可了。

当Git提交失败时,通常会返回一些错误信息,指示提交失败的原因。以下是一些常见的提交失败结果及其原因: 1. **合并冲突(Merge Conflict)**: 当你在一个分支上进行更改并尝试将其合并到另一个分支时,如果两个分支对同一文件的同一部分进行了不同的更改,就会发生合并冲突。Git会提示你手动解决冲突。 ```bash Auto-merging file.txt CONFLICT (content): Merge conflict in file.txt Automatic merge failed; fix conflicts and then commit the result. ``` 2. **缺少提交信息(Missing Commit Message)**: 如果你在提交时没有提供提交信息,Git会提示你输入提交信息。 ```bash Aborting commit due to empty commit message. ``` 3. **认证失败(Authentication Failure)**: 如果你在推送到远程仓库时输入了错误的用户名或密码,Git会返回认证失败的错误。 ```bash remote: Invalid username or password. fatal: Authentication failed for 'https://github.com/username/repository.git/' ``` 4. **远程仓库拒绝(Remote Rejection)**: 如果你没有权限向远程仓库推送更改,或者远程仓库设置了保护分支,Git会返回拒绝推送的错误。 ```bash ! [remote rejected] master -> master (protected branch hook declined) error: failed to push some refs to 'https://github.com/username/repository.git/' ``` 5. **本地仓库有未提交的更改(Uncommitted Changes)**: 如果你在推送之前有未提交的更改,Git会提示你先提交或暂存这些更改。 ```bash error: failed to push some refs to 'https://github.com/username/repository.git/' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值