git更換遠(yuǎn)程倉庫
方法一:不刪除遠(yuǎn)程倉庫修改
# 查看遠(yuǎn)端地址
git remote -v # 查看遠(yuǎn)端倉庫名git remote# 重新設(shè)置遠(yuǎn)程倉庫git remote set-url origin https://gitee.com/xx/xx.git (新地址)方法二:刪除遠(yuǎn)程倉庫修改
# 查看遠(yuǎn)端地址
git remote -v # 刪除遠(yuǎn)程的倉庫
git remote rm origin# 重新添加遠(yuǎn)程倉庫git remote add origin https://gitee.com/xx/xx.git(新地址)方法三:修改.git文件夾里的config配置文件
打開項(xiàng)目目錄下隱藏文件夾.git下的config文件內(nèi)容,將 [remote “origin”] url 修改成你需要替換的新地址:
[core]
repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true symlinks = false ignorecase = true[submodule] active = .[remote "origin"] url = https://gitee.com/xx/xx.git(新地址) fetch = +refs/heads/*:refs/remotes/origin/*[branch "master"] remote = origin merge = refs/heads/master

浙公網(wǎng)安備 33010602011771號(hào)