0
点赞
收藏
分享

微信扫一扫

下载远程git仓库配置为内部git仓库

微言记 2022-02-24 阅读 83
gitgithub

下载远程仓库,修改为自己的内部的git库,通过git remote set-url命令非常方便,先add内部的git地址,然后再delete原来的,然后push到内部git库,这样就成了。

git remote set-url --add origin git@git.xx.com:gstreamer/orc.git
git remote set-url --delete origin  git@gitlab.freedesktop.org:gstreamer/orc.git

git config --list --show-origin可以查看git仓库的详细配置:

$ git config --list --show-origin

file:/home/hui/.gitconfig       http.proxy=
file:/home/hui/.gitconfig       alias.st=status
file:/home/hui/.gitconfig       core.editor=vim
file:/home/hui/.gitconfig       color.ui=auto
file:/home/hui/.gitconfig       cola.spellcheck=false
file:/home/hui/.gitconfig       user.name=xxx
file:/home/hui/.gitconfig       user.email=xx@xx.com
file:/home/hui/.gitconfig       mergetool.keepbackup=false
file:.git/config        core.repositoryformatversion=0
file:.git/config        core.filemode=true
file:.git/config        core.bare=false
file:.git/config        core.logallrefupdates=true
file:.git/config        remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
file:.git/config        remote.origin.url=git@git.xx.com:gstreamer/orc.git
file:.git/config        branch.master.remote=origin
file:.git/config        branch.master.merge=refs/heads/master

如果要保留更多tag信息,也要将其他tag push到服务器上。

push tag通过命令:

git push --tags

还可以反着用,切换回原始git url,然后pull代码也是可以的:

git remote set-url --add origin git@gitlab.freedesktop.org:gstreamer/orc.git
git remote set-url --delete origin git@git.xx.com:gstreamer/orc.git
git pull
举报

相关推荐

Git远程仓库

git远程仓库

git提交远程仓库

关联远程Git仓库

3)Git远程仓库

git关联远程仓库

0 条评论