- 在码云客户端创建项目
- 然后在要上传的项目文件夹中右键 Git Bush Here
- 如下
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
网友评论