版本控制系统VCS (Version Control System)
一个可以管理和追踪软件代码或其他类似内容的不同版本的工具。
出于相同的目的:开发以及维护开发出来的代码、方便读取代码的历史版本、记录所有的修改、方便团队协作开发。
Git
Git简介 - 廖雪峰的官方网站 (liaoxuefeng.com)
Git安装
官方下载地址:
因为Git有很多新的配置项,而且之前也不懂,没有概念,之后可以考虑把这一块补充上,下面是一些参考链接,翻译可以用有道截图翻译(非常推荐)。
2022新版Git教程 从入门到实战(一)安装Git(一)-阿里云开发者社区 (aliyun.com)
配置项:
在git上和github上修改默认分支 - 掘金 (juejin.cn)
常用Git命令
1 | git remote prune origin 删除本地有但在远程库已经不存在的分支 <br> |
1 | git init |
命令流程图
版本控制系统VCS (Version Control System)
一个可以管理和追踪软件代码或其他类似内容的不同版本的工具。
出于相同的目的:开发以及维护开发出来的代码、方便读取代码的历史版本、记录所有的修改、方便团队协作开发。
Git
Git简介 - 廖雪峰的官方网站 (liaoxuefeng.com)
Git安装
官方下载地址:
因为Git有很多新的配置项,而且之前也不懂,没有概念,之后可以考虑把这一块补充上,下面是一些参考链接,翻译可以用有道截图翻译(非常推荐)。
2022新版Git教程 从入门到实战(一)安装Git(一)-阿里云开发者社区 (aliyun.com)
配置项:
在git上和github上修改默认分支 - 掘金 (juejin.cn)
常用Git命令
1 | git remote prune origin 删除本地有但在远程库已经不存在的分支 <br> |
1 | git init |
命令流程图

Bug&Solution
####ssh -T git@github.com
测试 SSH 连接
git push origin master报错的解决方法 & 常见git命令(待更新)
git 提交出现 Updates were rejected 解决方案
Remote “origin” does not support the LFS locking API
git项目push错分支的解决方法
好的解决方案:
main与master分支合并
未成功的方案:
GIT提交错分支,push错分支怎么办
解决git reset –soft HEAD^撤销commit时报错
fatal: ambiguous argument ‘HEAD^’: unknown revision or path not in the working tree.
git push报错
Updates were rejected because the tip of your current branch is behind (更新被拒绝,因为当前分支的落后与远程分支)
1 | git push -u origin main -f |
git push报错:Updates were rejected
进行git push操作时报错:fatal: The current branch master has no upstream branch.
原因:没有将本地的分支与远程仓库的分支进行关联
1 | git push -u origin main |
git push报错:The current branch master has no upstream branch
项目分支提交错误
已经push如何取消:
git reset –hard HEAD^
git push origin HEAD –force
文件超100M无法上传

1 | git lfs install |
error: GH001: Large files detected
Remote “origin” does not support the LFS locking API
git提交或克隆报错fatal: unable to access git仓库: Failed to connec
1 | git config --global --unset http.proxy |
Failed to connec -CSDN
Failed to connec -Stackoverflow
“warning: LF will be replaced by CRLF”警告
关于git提示“warning: LF will be replaced by CRLF”终极解答
删除本地git仓库
1 | rm -fr .git |
标志 -f 用于在没有提示的情况下强行删除不存在的文件和参数(小心使用)。
标志 -r 用于递归删除每个目录及其内容。
删除与远程仓库的连接
1 | git remote remove origin |
git add . 无响应
昨天登录平台把项目的vue文件下载下来后,放到当前的teach文件夹里,结果之后发现之前提交成功后的github仓库居然是空的,因此重新提交,但在git add的时候却出现无响应问题,最后发现原因可能是有两个example文件夹,里面有很多文件,导致git add . 无响应,将这两个文件夹删除后,重新提交就成功了。
还有就是文件太多导致锁住,删除.lock文件即可
1 | rm -f ./.git/index.lock |
git push 无响应
Connection closed by remote host
You‘ve successfully authenticated, but GitHub does not provide shell access.
在要推送的项目的本地文件夹下,右键 - Git Bash Here,执行命令:
1 | git remote set-url origin git@github.com:名字/仓库名.git |
Git 克隆并覆盖本地仓库
项目其他人下载到本地时,发现本地已经有了一个同名的文件夹,但是里面的内容不一样,这时候就需要覆盖本地仓库了
1 | git clone <远程仓库地址> <本地仓库名> |
与远程主机关闭 github.com 的连接
Connection to github.com closed by remote host.
与远程主机关闭 github.com 的连接
Bug&Solution
####ssh -T git@github.com
测试 SSH 连接
git push origin master报错的解决方法 & 常见git命令(待更新)
git 提交出现 Updates were rejected 解决方案
Remote “origin” does not support the LFS locking API
git项目push错分支的解决方法
好的解决方案:
main与master分支合并
未成功的方案:
GIT提交错分支,push错分支怎么办
解决git reset –soft HEAD^撤销commit时报错
fatal: ambiguous argument ‘HEAD^’: unknown revision or path not in the working tree.
git push报错
Updates were rejected because the tip of your current branch is behind (更新被拒绝,因为当前分支的落后与远程分支)
版本控制系统VCS (Version Control System)
一个可以管理和追踪软件代码或其他类似内容的不同版本的工具。
出于相同的目的:开发以及维护开发出来的代码、方便读取代码的历史版本、记录所有的修改、方便团队协作开发。
Git
Git简介 - 廖雪峰的官方网站 (liaoxuefeng.com)
Git安装
官方下载地址:
因为Git有很多新的配置项,而且之前也不懂,没有概念,之后可以考虑把这一块补充上,下面是一些参考链接,翻译可以用有道截图翻译(非常推荐)。
2022新版Git教程 从入门到实战(一)安装Git(一)-阿里云开发者社区 (aliyun.com)
配置项:
在git上和github上修改默认分支 - 掘金 (juejin.cn)
常用Git命令
1 | git remote prune origin 删除本地有但在远程库已经不存在的分支 <br> |
1 | git init |
命令流程图

Bug&Solution
####ssh -T git@github.com
测试 SSH 连接
git push origin master报错的解决方法 & 常见git命令(待更新)
git 提交出现 Updates were rejected 解决方案
Remote “origin” does not support the LFS locking API
git项目push错分支的解决方法
好的解决方案:
main与master分支合并
未成功的方案:
GIT提交错分支,push错分支怎么办
解决git reset –soft HEAD^撤销commit时报错
fatal: ambiguous argument ‘HEAD^’: unknown revision or path not in the working tree.
git push报错
Updates were rejected because the tip of your current branch is behind (更新被拒绝,因为当前分支的落后与远程分支)
1 | git push -u origin main -f |
git push报错:Updates were rejected
进行git push操作时报错:fatal: The current branch master has no upstream branch.
原因:没有将本地的分支与远程仓库的分支进行关联
1 | git push -u origin main |
git push报错:The current branch master has no upstream branch
项目分支提交错误
已经push如何取消:
git reset –hard HEAD^
git push origin HEAD –force
文件超100M无法上传

1 | git lfs install |
error: GH001: Large files detected
Remote “origin” does not support the LFS locking API
git提交或克隆报错fatal: unable to access git仓库: Failed to connec
1 | git config --global --unset http.proxy |
Failed to connec -CSDN
Failed to connec -Stackoverflow
“warning: LF will be replaced by CRLF”警告
关于git提示“warning: LF will be replaced by CRLF”终极解答
删除本地git仓库
1 | rm -fr .git |
标志 -f 用于在没有提示的情况下强行删除不存在的文件和参数(小心使用)。
标志 -r 用于递归删除每个目录及其内容。
删除与远程仓库的连接
1 | git remote remove origin |
git add . 无响应
昨天登录平台把项目的vue文件下载下来后,放到当前的teach文件夹里,结果之后发现之前提交成功后的github仓库居然是空的,因此重新提交,但在git add的时候却出现无响应问题,最后发现原因可能是有两个example文件夹,里面有很多文件,导致git add . 无响应,将这两个文件夹删除后,重新提交就成功了。
还有就是文件太多导致锁住,删除.lock文件即可
1 | rm -f ./.git/index.lock |
git push 无响应
Connection closed by remote host
You‘ve successfully authenticated, but GitHub does not provide shell access.
在要推送的项目的本地文件夹下,右键 - Git Bash Here,执行命令:
1 | git remote set-url origin git@github.com:名字/仓库名.git |
Git 克隆并覆盖本地仓库
项目其他人下载到本地时,发现本地已经有了一个同名的文件夹,但是里面的内容不一样,这时候就需要覆盖本地仓库了
1 | git clone <远程仓库地址> <本地仓库名> |
与远程主机关闭 github.com 的连接
Connection to github.com closed by remote host.
与远程主机关闭 github.com 的连接
1 | git push -u origin main -f |
git push报错:Updates were rejected
进行git push操作时报错:fatal: The current branch master has no upstream branch.
原因:没有将本地的分支与远程仓库的分支进行关联
1 | git push -u origin main |
git push报错:The current branch master has no upstream branch
项目分支提交错误
已经push如何取消:
git reset –hard HEAD^
git push origin HEAD –force
文件超100M无法上传
版本控制系统VCS (Version Control System)
一个可以管理和追踪软件代码或其他类似内容的不同版本的工具。
出于相同的目的:开发以及维护开发出来的代码、方便读取代码的历史版本、记录所有的修改、方便团队协作开发。
Git
Git简介 - 廖雪峰的官方网站 (liaoxuefeng.com)
Git安装
官方下载地址:
因为Git有很多新的配置项,而且之前也不懂,没有概念,之后可以考虑把这一块补充上,下面是一些参考链接,翻译可以用有道截图翻译(非常推荐)。
2022新版Git教程 从入门到实战(一)安装Git(一)-阿里云开发者社区 (aliyun.com)
配置项:
在git上和github上修改默认分支 - 掘金 (juejin.cn)
常用Git命令
1 | git remote prune origin 删除本地有但在远程库已经不存在的分支 <br> |
1 | git init |
命令流程图

Bug&Solution
####ssh -T git@github.com
测试 SSH 连接
git push origin master报错的解决方法 & 常见git命令(待更新)
git 提交出现 Updates were rejected 解决方案
Remote “origin” does not support the LFS locking API
git项目push错分支的解决方法
好的解决方案:
main与master分支合并
未成功的方案:
GIT提交错分支,push错分支怎么办
解决git reset –soft HEAD^撤销commit时报错
fatal: ambiguous argument ‘HEAD^’: unknown revision or path not in the working tree.
git push报错
Updates were rejected because the tip of your current branch is behind (更新被拒绝,因为当前分支的落后与远程分支)
1 | git push -u origin main -f |
git push报错:Updates were rejected
进行git push操作时报错:fatal: The current branch master has no upstream branch.
原因:没有将本地的分支与远程仓库的分支进行关联
1 | git push -u origin main |
git push报错:The current branch master has no upstream branch
项目分支提交错误
已经push如何取消:
git reset –hard HEAD^
git push origin HEAD –force
文件超100M无法上传

1 | git lfs install |
error: GH001: Large files detected
Remote “origin” does not support the LFS locking API
git提交或克隆报错fatal: unable to access git仓库: Failed to connec
1 | git config --global --unset http.proxy |
Failed to connec -CSDN
Failed to connec -Stackoverflow
“warning: LF will be replaced by CRLF”警告
关于git提示“warning: LF will be replaced by CRLF”终极解答
删除本地git仓库
1 | rm -fr .git |
标志 -f 用于在没有提示的情况下强行删除不存在的文件和参数(小心使用)。
标志 -r 用于递归删除每个目录及其内容。
删除与远程仓库的连接
1 | git remote remove origin |
git add . 无响应
昨天登录平台把项目的vue文件下载下来后,放到当前的teach文件夹里,结果之后发现之前提交成功后的github仓库居然是空的,因此重新提交,但在git add的时候却出现无响应问题,最后发现原因可能是有两个example文件夹,里面有很多文件,导致git add . 无响应,将这两个文件夹删除后,重新提交就成功了。
还有就是文件太多导致锁住,删除.lock文件即可
1 | rm -f ./.git/index.lock |
git push 无响应
Connection closed by remote host
You‘ve successfully authenticated, but GitHub does not provide shell access.
在要推送的项目的本地文件夹下,右键 - Git Bash Here,执行命令:
1 | git remote set-url origin git@github.com:名字/仓库名.git |
Git 克隆并覆盖本地仓库
项目其他人下载到本地时,发现本地已经有了一个同名的文件夹,但是里面的内容不一样,这时候就需要覆盖本地仓库了
1 | git clone <远程仓库地址> <本地仓库名> |
与远程主机关闭 github.com 的连接
Connection to github.com closed by remote host.
与远程主机关闭 github.com 的连接
1 | git lfs install |
error: GH001: Large files detected
Remote “origin” does not support the LFS locking API
git提交或克隆报错fatal: unable to access git仓库: Failed to connec
1 | git config --global --unset http.proxy |
Failed to connec -CSDN
Failed to connec -Stackoverflow
“warning: LF will be replaced by CRLF”警告
关于git提示“warning: LF will be replaced by CRLF”终极解答
删除本地git仓库
1 | rm -fr .git |
标志 -f 用于在没有提示的情况下强行删除不存在的文件和参数(小心使用)。
标志 -r 用于递归删除每个目录及其内容。
删除与远程仓库的连接
1 | git remote remove origin |
git add . 无响应
昨天登录平台把项目的vue文件下载下来后,放到当前的teach文件夹里,结果之后发现之前提交成功后的github仓库居然是空的,因此重新提交,但在git add的时候却出现无响应问题,最后发现原因可能是有两个example文件夹,里面有很多文件,导致git add . 无响应,将这两个文件夹删除后,重新提交就成功了。
还有就是文件太多导致锁住,删除.lock文件即可
1 | rm -f ./.git/index.lock |
git push 无响应
Connection closed by remote host
You‘ve successfully authenticated, but GitHub does not provide shell access.
在要推送的项目的本地文件夹下,右键 - Git Bash Here,执行命令:
1 | git remote set-url origin git@github.com:名字/仓库名.git |
Git 克隆并覆盖本地仓库
项目其他人下载到本地时,发现本地已经有了一个同名的文件夹,但是里面的内容不一样,这时候就需要覆盖本地仓库了
1 | git clone <远程仓库地址> <本地仓库名> |
与远程主机关闭 github.com 的连接
Connection to github.com closed by remote host.
与远程主机关闭 github.com 的连接