首页 > 其他 > 详细

gitup问题的处理

时间:2017-12-10 15:11:16      阅读:271      评论:0      收藏:0      [点我收藏+]

在使用本地建立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   即可

gitup问题的处理

原文:http://www.cnblogs.com/liuzoudeshazi/p/8016902.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!