今天 在idea 上使用git 提交代码 commit --add -- push 嗯嗯 然后哩。。
push reject push to origin/master was rejected
然后用git brash 在idea 工作目录打开它,继续 add. git pull 嗯 继续报错:
warning: no common commits
给出提示:
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=<remote>/<branch> master
嗯 我去看看当前的远程仓库分支:
git remote -v
en 这回看到远程分支了、。。
git pull origin upstream --allow-unrelated-histories 执行 (upstream 为远程分支名字)
结果 :
fatal: Couldn't find remote ref upstream
。。嗯 报错。。
发现原来是远程仓库分支名字写错 。。改之。
git pull origin master --allow-unrelated-histories
嗯 终于可以拉取 远程仓库到本地了。并给以合并操作了,,嗯 接下来是一顿疯狂修改冲突文件:
head 与==之间的是你自己要提交的 ====与 ===65655656 这个之间的 是服务器的。。
嗯 你自己看 要留服务器的还是留自己的。。嗯
经过这几步 终于可以大功告成了吧, 嗯
执行提交:
git push origin master:master
($ git push <远程主机名> <本地分支名>:<远程分支名>
也就是 $git push origin master:master 提交成功。)
成功了么? 结果:
fatal: Authentication failed for 'https:。。。。
嗯 理所当然的失败了。。。
Push failed
这时使用 idea git 提交 提示:
Invocation failed Server returned invalid Response.
。。。。。。。。
。。。
remote: No anonymous write access.
Authentication failed for 'https://github.com/huhu11... (show balloon)
这是为啥了?
电脑进入到
控制面板\用户帐户\凭据管理器
将普通用户下的账户删除掉!!!
嗯 这次 再回到idea 在idae中 commit -->add --->push
选择你要提交的文件 。commit 。。写好备注。。提交。。嗯
成功了!!!
总结 : 在git上传文件的时候。要先add 然后 在pull 更改冲突之后再push 如果 提示权限问题 看看 是否本地有创建的账户 与要用的账户不一致,如果不一致 要删除掉。这样就可以了
idea 提交 步骤。 先 pull 有新增(出现红色的) 先add 再 commit 都是绿色 直接commit 最后push
注意 如果提示出现 remote:no anoymouse write access, 注意 在设置中查看下你的账号信息是不是正确的,如果不正确,修改它;