• git 常见错误及处理


    同步远程仓库到本地

    git pull=git fetch + merge

    $ git pull --rebase origin master

    error: cannot pull with rebase: You have unstaged changes.
    error: please commit or stash them.

    有修改了的文件,但是没有提交。这种情况可以用git status查看哪些文件修改了没有提交,可以提交这些文件。或者,放弃这些文件的修改(git restore)



    git status

    git restore DoctoralDissertationCollection/settings.py



    error: The following untracked working tree files would be overwritten by merge:
            user/__init__.py
    Please move or remove them before you merge.

    Aborting
    error: could not detach HEAD

    有文件没有加入版本控制中,但是下载的新文件和该文件同名,此时,可以删除本地的该文件。



    Your branch is up to date with 'origin/master'.

    Changes not staged for commit:
      (use "git add <file>..." to update what will be committed)
      (use "git restore <file>..." to discard changes in working directory)
            modified:   .idea/workspace.xml
            modified:   DoctoralDissertationCollection/settings.py

    Untracked files:
      (use "git add <file>..." to include in what will be committed)
            DoctoralDissertationCollection/__pycache__/__init__.cpython-38.pyc
            DoctoralDissertationCollection/__pycache__/settings.cpython-38.pyc



  • 相关阅读:
    MySQL读写分离
    Error:(1, 1) java: 非法字符: ‘ufeff’
    Java 集合系列(四)—— ListIterator 源码分析
    Java 集合系列(三)—— LinkedList
    Java 集合系列(二)—— ArrayList
    Java 集合系列(一)
    Docker之进入容器(三)
    Docker之常用命令(二)
    Docker之初识(一)
    Redis可视化工具 Redis Desktop Manager
  • 原文地址:https://www.cnblogs.com/emanlee/p/16353124.html
Copyright © 2020-2023  润新知