zoukankan      html  css  js  c++  java
  • git学习小结(未完待续)

    错误一

    Updates were rejected because the remote contains work that you do

     ! [rejected]        master -> master (fetch first)
    error: failed to push some refs to 'https://github.com/icessun/baiduWebShool.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 origin master     抓取远端的内容
    $ git push origin master     重新推送到远程仓库

    错误二

    Your local changes to the following files would be overwritten by checkout:

    Administrator MINGW32 /d/blog (dev)
    $ git checkout master
    error: Your local changes to the following files would be overwritten by checkout:
            .idea/workspace.xml
    Please commit your changes or stash them before you switch branches.
    Aborting
    

    错误的原因是:直接在远程仓库包操作了,修改了github上面的东西,相当于服务器上面的东西,而本地没有修改,当想改变分支的时候,出现了改变分支的时候会重写文件,所以必须把修改的提交到版本库里面。或者是隐藏在你切换分支之前。


    解决办法:

    • 抛弃本地的修改,回到上一个版本

      git reset --hard
      然后,切换你的分支
      git checkout master 
  • 相关阅读:
    scp远程文件传输
    ssh远程登录
    PHP PDO使用
    Linux引导流程
    Samba服务器搭建
    linux ftp服务器搭建
    NfS服务的搭建
    Discuz! X2.5数据库字典【转载】
    javaSctipt基础
    压缩文件 compress files 以7z 格式及解压 或者别的格式
  • 原文地址:https://www.cnblogs.com/linewman/p/9918382.html
Copyright © 2011-2022 走看看