linux往github中上传文件

error1:
*** Please tell me who you are.

Run

git config --global user.email “you@example.com”
git config --global user.name “Your Name”

to set your account’s default identity.
Omit --global to set the identity only in this repository.

fatal: empty ident name (for <ubuntu@dd9a185721c2.(none)>) not allowed

解决:git config user.email 你的邮箱
git config user.name 你的github名字

error2: src refspec master does not match any.(目录中没有文件,空目录是不能提交上去的 )
解决:
touch README
git add README
 
步骤:
git init //关联git上新建的仓库前,需要在linux中上传文件路径下,新建git仓库,在文件夹下有.git文件;
git remote add origin xxxx 创建一个origin为仓库的名字(可能你的本地项目关联着几个仓库,你可以根据仓库的名字提交到git push origin master )
git pull origin master先将github上的代码pull下来,与本地仓库合并。
git push origin master 将本地仓库的文件上传到git远程仓库

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值