赞
踩
1、自己找一个放项目的位置,创建一个文件夹
2、根据项目需求创建项目
创建一个vue项目,可参考下面文章:
https://blog.csdn.net/weixin_45048913/article/details/106210728
1、先进行如下操作:
2、在命令行输入ssh-keygen -t rsa -C生成key
ssh-keygen -t rsa -C "youail@163.com"
3、生成之后将id_rsa文件里的栋西全部复制到key里
依次进行一下操作:
1、git init
通过命令git init把这个文件夹变成Git可管理的仓库
2、git add README.md
3、git commit -m “first commit”
4、git remote add origin git@github.com:Red-rou/vue-demo.git
5、git push -u origin master
一般情况下,进项以上操作就ok了,会出现一下几种情况的问题:
1、git push报错
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin master
或者
To github.com:Red-rou/demo.git
! [rejected] dev -> dev (non-fast-forward)
error: failed to push some refs to 'git@github.com:Red-rou/demo.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
决绝办法:
1)commit之后先进行这行命令讲线上和本地进行合并:git pull --rebase origin master
2)此时再执行语句 git push -u origin master即可完成代码上传到github
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。