美文网首页
gitee 上传项目

gitee 上传项目

作者: 殷天文 | 来源:发表于2018-09-06 14:22 被阅读74次
  1. 在码云客户端创建项目
  2. 然后在要上传的项目文件夹中右键 Git Bush Here
  3. 如下
git config --global user.name "殷天文"
git config --global user.email "yintianwen7@qq.com"
git init
git remote add origin https://xxx
git add .
git commit -m "init"
git push -u origin master

在执行 git push -u origin master 时
由于我在 gitee 创建项目时,生成readme,导致本地仓库与远端不一致

To https://gitee.com/yintianwen7/spring-dynamic-datasource.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://gitee.com/yintianwen7/spring-dynamic-datasource.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.

解决方法

git pull --rebase origin master

相关文章

网友评论

      本文标题:gitee 上传项目

      本文链接:https://www.haomeiwen.com/subject/bjihwftx.html