<
修改远程仓库地址
>
上一篇

常用的 git命令
下一篇

使用git命令ssh提交项目到github

方式一

命令:

git remote set-url origin URL

方式二

命令:

git remote rm origin
git remote add origin URL
(重新设置upstream branch.
git push --set-upstream origin master
)

方式三

直接修改.git文件夹下config文件

文件内容:

[core]
	repositoryformatversion = 0
	filemode = false
	bare = false
	logallrefupdates = true
	symlinks = false
	ignorecase = true
[branch "master"]
[remote "origin"]
	url = http://mozhx:9527/r/test.git
	fetch = +refs/heads/*:refs/remotes/origin/*
[remote "origin2"]
	url = http://mozhx:9527/r/test2.git
	fetch = +refs/heads/*:refs/remotes/origin2/*

branch是本地分支

romote是远程仓库

所以可以移除再添加或者直接添加名称不重复的(方法2)

里面的url是可以直接设置(方法1)

Top
Foot