git 创建项目第一次上传文档出现fatal: No configured push destination. Either specify the URL from the command-line

最近由于疫情的原因,需要在家办公,我的老式电脑下载了各种办公需要的工具,在git的使用上遇到了一些问题,过程记录一下吧

git init
git clone '当前项目的git地址'

然后根据提示操作,输入了usename和password,继续

git add .

git commit -m ''

git push

一直OK,到了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 'http://git.....'
 git push -u origin master

我自己建的项目,是master身份,所以最后一句命令的远程分支名就写了master,具体应情况而定,
在这里插入图片描述
到此就成功了!

  • 13
    点赞
  • 40
    收藏
    觉得还不错? 一键收藏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值