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
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· winform 绘制太阳,地球,月球 运作规律
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
2020-06-07 Excel VBA form code
2020-06-07 Excel VBA Chart.Export
2020-06-07 Excel VBA Chart 刻度 Axis.DisplayUnit
2020-06-07 Excel VBA Convert Text String to Number
2017-06-07 R语言文件相关的操作
2017-06-07 Linux 在一个命令行上执行多个命令
2014-06-07 R语言常用基础知识(入门)