码迷,mamicode.com
首页 > 其他好文 > 详细

Git报错:Your branch is ahead of 'origin/master' by 1 commit

时间:2018-06-22 13:21:00      阅读:1889      评论:0      收藏:0      [点我收藏+]

标签:end   other   hang   mit   tor   打印   The   一个   director   

.    commit之后,用git status,打印信息为:

# On branch master
# Your branch is ahead of ‘origin/master‘ by 1 commit.
#
nothing to commit (working directory clean)

说明没有文件需要commit,但是本地仓库 有一个commit ahead原来的master,就是本地仓库有一个提交,比远程仓库要先进一个commit。

You get that message because you made changes in your local master and you didn’t push them to remote. You have several ways to “solve” it and it normally depends on how your workflow looks like:

  • If you work in another way and your local changes should be pushed then just

git push origin

  • 1

assuming origin is your remote

  • If your local changes are bad then just remove them or reset your local master to the state on remote

 git reset --hard origin/master

Git报错:Your branch is ahead of 'origin/master' by 1 commit

标签:end   other   hang   mit   tor   打印   The   一个   director   

原文地址:https://www.cnblogs.com/hilaryqs/p/9212576.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!