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 连接到远程仓库

相关推荐
TeleostNaCl2 小时前
OpenWrt 编译 | 一种使用 git submodule 方式实现一键更新多个外部软件包
网络·经验分享·git·智能路由器
Cosmoshhhyyy16 小时前
mac环境下安装git并配置密钥等
git·macos
yuwei02116 小时前
git大全解
git
小林的技术分享20 小时前
版本控制系统-Git 学习 《progit》电子书学习记录 第一章 (仅隔个人学习记录用)
git
weixin_456904271 天前
Git登录配置的详细方法
git
鄃鳕1 天前
Git , 本地落后远端
git
Yusei_05231 天前
迅速掌握Git通用指令
大数据·git·elasticsearch
qq_377572772 天前
git commit - revert + reset + checkout + reorder
git
2301_767233222 天前
Git使用和理解上的一些问题
git
nyf_unknown2 天前
(vue)将文件夹打成tar包, Git Bash(推荐)具体使用
vue.js·git·bash