git提交的BUG修改汇总

在进行如下的代码提交后

git add .  

git commit -m '提交'

在进行如下的命令

git push 

会出现如下的错误

$ git push
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>

解决办法

(其实上面已经给出写的报错原因已经给了)

增加如下代码

$ git  remote add origin  '你自己要上传的远程地址':
$ git  remote add origin  https://gitee.com/AristoVBY/kuang-shen.git

然后再点击运行如下代码

git push origin master

发现会报如下的错误

image-20211224144601772

解决办法

--运行下面代码(拉取文件)
$ git pull --rebase origin master

image-20211224144829554

再次点击push

git push origin master

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-JVC5Fb9M-1640329887246)(https://s2.loli.net/2021/12/24/Mfq8DG9TaRObcdV.png)]

然后进入自己的repository中进行查看提交状态(提交后的状态)

image-20211224150846219

结果:

image-20211224151024593

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐