• 生活就是这样,需要去灌溉!
    • 谢谢您的关注,欢迎您的注册与写作!
    • 循环往复,生生不息,或许这就是生命的意义吧!生命是插曲的产品吧!
    • 古今多少事,都付笑言中!
    • 风住尘香花已尽,日晚倦梳头。物是人非事事休,欲语泪先流。
    • 闻说双溪春尚好,也拟泛轻舟,只恐双溪舴艋舟,载不动许多愁。

Git教程:! [rejected] master -> master (fetch first)解决办法

Git 柳叶扉鸿 来源:CSDN:baidu_26759899/云梦影 5年前 (2020-07-28) 1719次浏览 已收录 扫描二维码
内容目录

在 github 上修改过 readme.md 后,在本地执行 git push origin master 后会提示:

$ git push origin master
To github.com:taozhuowei/StoreMyToys.git
! [rejected]        master -> master (fetch first)
error: failed to push some refs to ‘git@github.com:taozhuowei/StoreMyToys.git’
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., ‘git pull …’) before pushing again.
hint: See the ‘Note about fast-forwards’ in ‘git push –help’ for details.

 

解决方式:git pull –rebase origin master 将 github 修改的文件更新到本地

$ git pull –rebase origin master
remote: Enumerating objects: 21, done.
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 17 (delta 4), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (17/17), 3.99 KiB | 5.00 KiB/s, done.
From github.com:taozhuowei/StoreMyToys
* branch            master     -> FETCH_HEAD
5afe506..b843c89  master     -> origin/master
First, rewinding head to replay your work on top of it…
Applying: commit Vue to-do
再次提交:git push origin master

$ git push origin master
Enumerating objects: 26, done.
Counting objects: 100% (26/26), done.
Delta compression using up to 8 threads
Compressing objects: 100% (22/22), done.
Writing objects: 100% (25/25), 49.42 KiB | 153.00 KiB/s, done.
Total 25 (delta 0), reused 0 (delta 0)
To github.com:taozhuowei/StoreMyToys.git
b843c89..bc04ef1  master -> master
提交成功

————————————————
版权声明:本文为 CSDN 博主「云梦影」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/yunmengying/article/details/105487691


柳叶扉鸿 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明Git教程:! [rejected] master -> master (fetch first)解决办法
相关文章
喜欢 (1)