BestDI / BestDI.github.io

Mia's Home
https://bestdi.github.io
1 stars 0 forks source link

🦒 git 远程仓库地址变更本地修改 #42

Open BestDI opened 4 years ago

BestDI commented 4 years ago

git 远程仓库地址变更本地修改

🎲 1. 通过命令直接修改远程地址

git remote -v 查看所有远程仓库, 
git remote xxx 查看指定远程仓库地址
git remote set-url origin http://****/git_test.git

2. 通过命令先删除再添加远程仓库

git remote rm origin
git remote set-url origin http://****/git_test.git

3. 直接修改配置文件

进入 /.git

vim config
[core]
repositoryformatversion = 0
filemode = true
logallrefupdates = true
precomposeunicode = true
[remote "origin"]
url = git remote set-url origin http://****/git_test.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master

修改 [remote “origin”]下面的url即可