Ubuntu将本地内容上传到自己的github

1 篇文章 0 订阅

第一次上传

进入所在的文档目录
依次输入以下指令
git init
git commit

这里可能提示你:


*** 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: unable to auto-detect email address (got '.......(none)')

输入下面指令即可:
git config --global user.email "you@example.com"
you@example.com是你注册Github的邮箱!
而后在输入:git commit
这里也可能呢个出现如下提示:

未跟踪的文件:
.............
............

输入:git add -A即可。
这个时候呢你需要进入你的github页面,查看一下你成功创建的项目的地址,如下:

找到这个地址后输入下面指令:
git remote add origin https://github.com/einking/-Beego-MysQl-.git
https://github.com/einking/-Beego-MysQl-.git这个地址就是我们刚才寻找的地址!
然后会跳出一个界面,我这里是nano的,只需要退出即可,什么都不用改!
依次输入:
git push -u origin master
好了,这样就传上去了!下面是一些我学习的一些常用指令,并没有自己实验,参考!
添加远程仓库:$ git remote add [name] [url]
git push:将本地commit的代码更新到远程版本库中,例如’git push origin’就会将本地的代码更新到名为orgin的远程版本库中
强制更新:git push -u origin +master

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值