标签:use hint tip origin before erp git push current push
在使用本地建立git仓库后,准备使用
因为之前已经登录了,所以没有给登录的命令行
1、git init 命令初始化仓库
2、git add . 命令将所有的文件传输到git仓库中
3、git commit -m ‘提交代码‘ 命令将本地修改的内容提交到缓存中,并未提交到gitup中
4、git remote add origin gitup项目地址 命令与gitup建立联系
5、git push -u origin master 命令以管理员身份将缓存中的代码提交到gitup上
之前将一切都布置好,所以以这几条命令即可将代码提交上去,但是后来要上传代码,出现了报错
$ git push -u origin master
To https://github.com/sylvia-yun/takegism.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to ‘https://github.com/sylvia-yun/takegism.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 push -u origin master -f 即可
标签:use hint tip origin before erp git push current push
原文地址:http://www.cnblogs.com/liuzoudeshazi/p/8016902.html