抱歉,您的浏览器无法访问本站

本页面需要浏览器支持(启用)JavaScript


了解详情 >

清除Git历史提交记录

在不删除原仓库的前提下,如何清除原仓库的所有历史提交记录(包含:分支、tag),可以按照以下方法来实现, 大概流程: graph LR 新建分支-->提交文件到新分支-->删除原分支-->新分支改名为原分支 具体操作步骤: (假如旧分支名称:master,新分支名称:latest_master) 创建新分支进入当前 git 目录(master 分支)执行命令: git ch...

Git 修改 commit 的用户名和邮箱

查看当前用户名和邮箱$ git config user.name $ git config user.email 修改全局用户名和邮箱$ git config --global user.name "username" $ git config --global user.email "email@example.com" 如果只是设置当前项目的用...

Git提示Fatal-unsafe-repository

在当前 Git 目录执行 git 命令时出现错误提示❌: fatal: unsafe repository ('/zerow/directory' is owned by someone else) To add an exception for this directory, call: git config --global --add safe.dir...

git忽略提交文件和文件夹

未追踪文件打开 git 存储仓库的 .gitignore 文件,输入需要排除的文件或文件夹, # Visual Studio 2015/2017 cache/options directory .vs/ # User-specific files *.rsuser *.suo *.user *.userosscache *.sln.docstates # Build results [D...

Git pull冲突解决

本地执行 git pull 命令时提示: error: Your local changes to the following files would be overwritten by merge: cs/fr.cs file/index.html Please commit your changes or stash them before you mer...

Git提示错误HttpRequestException encountered

执行git pull命令的时候出现错误: $ git pull fatal: HttpRequestException encountered. An error occurred while sending the request. Already up to date. 解决办法: 更新Git Credential Manager 下载地址:https://github.com/m...

Git提示`refusing to merge unrelated histories`

Git提示refusing to merge unrelated histories git pull时提示“fatal: refusing to merge unrelated histories” 解决办法: 添加“--allow-unrelated-histories” 这样执行: git pull origin master --allow-unrelated-histories 即...

Git提交与撤销操作

1. 本地修改了一些文件 (并没有使用 git add 到暂存区),想放弃修改 单个文件/文件夹: git checkout -- filename 所有文件/文件夹: git checkout . 2. 本地新增了一些文件 (并没有 git add 到暂存区),想放弃修改 单个文件/文件夹: rm -rf filename 所有文件: git clean -xdf 删除新增的文...

git基本操作

介绍git的一些基本操作,包括仓库的创建和关联,代码的提交、推送、修改...

Windows环境下多个SSH Key配置

配置密钥假如需要在本机配置多个 Git 账户(比如 GitHub 和 CODING等等 ),那么在 C:\Users\用户名\.ssh 目录下将要生成多份密钥文件。 生成 GitHub 密钥 打开 git bash,生成 SSH Key ssh-keygen -t rsa -C 邮箱地址 -f id_rsa.github 执行命令后会两次提示输入密码,可直接回车即可。生成成功会提示:“You...