克隆
将远程仓库克隆到本地
git clone https://gitee.com/用户个性地址/仓库名.git
从远程仓库更新本地项目
git pull
将本地更新上传至远程仓库
git add .
git commit -m "这里写你更新了啥"
git push origin master
提交失败
一直报这个错:
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to ‘https://gitee.com/zhuayizhimiao/etr_system.git’
很多教程说是不一致的问题,我重新pull了很多遍也没用。
注意在git commit时,会有提醒信息。可能之前提交了多个版本但没有push上去,按需要进行下面两个命令的选取,然后再进行push。
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
如果还有错,先pull,会发现有git (master|MERGING)这样的绿色提示。就是代码有冲突,找到标红的文件改到没冲突就可以上传了。如果还是不能push,说明还是有冲突。