Git提交项目到码云的流程
Git bash
- 进入本地项目 cd ‘目录’
- 初始化本地仓库 git init
- 将项目添加到本地仓库 git add .
- 查看git状态 git status
- commit 到本地仓库 git commit -am “提交信息”
- 理解远程码云仓库 git remote add origin 仓库地址
- 先拉取项目 git pull
- 推送项目至码云 git push -u -f origin master
git 异常问题解决方案
git Updates were rejected because the tip of your current branch is behind
push前先将远程repository修改pull下来
$ git pull origin master
$ git push -u origin master
Git fatal: refusing to merge unrelated histories
git pull origin master --allow-unrelated-histories
git 设置全局用户名和密码
git config --global credential.helper store