Tortoise Git(乌龟git)常用命令总结

查看全局和本地 Git 配置

打开命令行终端(如 Git Bash),分别执行以下命令查看全局和本地的 Git 配置信息:

bash 复制代码
git config --global -l
git config --local -l

确保配置中没有任何与 SSH 相关的设置

移除全局和本地 SSH 相关配置: 如果上述命令中出现了与 SSH 相关的配置,可以使用以下命令移除这些配置:

bash 复制代码
git config --global --unset user.email
git config --global --unset user.name
git config --global --unset remote.origin.url
git config --local --unset user.email
git config --local --unset user.name
git config --local --unset remote.origin.url

上述命令中的 remote.origin.url 是指远程仓库的 URL,确保它没有指向 SSH URL。

git如何修改 remote.origin.url由ssh到https ?

git如何修改 remote.origin.url由ssh到https

查看当前远程仓库 URL: 打开命令行终端,进入你的 Git 仓库目录,然后执行以下命令来查看当前的远程仓库 URL:

bash 复制代码
git remote -v

这将显示当前仓库的所有远程仓库信息,包括名称(通常是 origin)和 URL。

修改远程仓库 URL: 使用以下命令来修改远程仓库的 URL。将 <new_https_url> 替换为你希望使用的 HTTPS URL,然后执行以下命令:

bash 复制代码
git remote set-url origin <new_https_url>

例如:

bash 复制代码
git remote set-url origin https://github.com/yourusername/yourrepository.git

这将把远程仓库的 URL 修改为新的 HTTPS URL。

验证修改: 使用以下命令验证远程仓库的 URL 是否已成功修改:

bash 复制代码
git remote -v
  1. 确保显示的 URL 是你设置的新的 HTTPS URL。

现在,你的 Git 仓库应该已经成功将远程仓库 URL 从 SSH 修改为 HTTPS。以后执行 git pullgit push 等操作时,将使用 HTTPS 连接到远程仓库

相关推荐
HelloDam2 小时前
Git简洁安装方式和使用方式【附安装包资源,Git基础操作,如拉取项目、上传代码、拉取代码】
git·github
咖啡教室19 小时前
日常开发中常用的git操作命令和使用技巧
git
carterwu1 天前
git工作流程的分类和对应场景
git
2401_840192271 天前
如何学习一门计算机技术
开发语言·git·python·devops
EleganceJiaBao1 天前
【Git】5 个分区的切换方式及示例
git·github·add
LCY1332 天前
spring 中的DAO是什么
运维·git·jenkins
柚几哥哥2 天前
IntelliJ IDEA全栈Git指南:从零构建到高效协作开发
java·git·intellij-idea
遇到困难睡大觉哈哈2 天前
Git推送错误解决方案:`rejected -> master (fetch first)`
大数据·git·elasticsearch
ON.LIN2 天前
Git提交本地项目到Github
git·github
九月镇灵将2 天前
6.git项目实现变更拉取与上传
git·python·scrapy·scrapyd·gitpython·gerapy