第一次上传
进入所在的文档目录
依次输入以下指令
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