如何使用CLI从现有的本地git仓库创建新的gitlab仓库? [英] How to create a new gitlab repo from my existing local git repo, using CLI?

查看:185
本文介绍了如何使用CLI从现有的本地git仓库创建新的gitlab仓库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的OSX上有很多本地git仓库。使用命令行我想在 https://gitlab.ccompanyname.com 上制作新的gitlab软件仓库,形成现有的本地仓库。



有可能做到这一点吗?

解决方案

在GitLab中为每个要推送给GitLab的本地回购库创建新的空项目。创建项目后,您将进入默认项目页面。

然后cd到你现有的每个git仓库中。做一个 git remote add origin<你的新gitlab repo地址>

然后一个 git push -u origin master



您需要为您想要添加的每个回购站点执行此操作。



您的回购地址在项目页面上给您。作为http和/或ssh。如果您的本地计算机上已经有一个远程调用来源,则可能需要先将其重命名。或者你可以调用一个不同的gitlab。此外,如果你想推动所有分支机构到gitlab,你可以做一个 git push --all origin 如果你想要你的标签, git push - 标签来源


I have many local git repos on my OSX. Using command line I want to make new gitlab repos on https://gitlab.ccompanyname.com, form existing local repos.

Is it possible to do that?

解决方案

Create new empty projects in GitLab for each of your local repos you want to push to GitLab. After you create the project's, you will be taken to the default project page.

Then cd into each of your existing git repos. Do a git remote add origin <your new gitlab repo address>

And then a git push -u origin master

You will need to do this for each of your repos you want to add.

Your repo address is given to you on the project page. As http and/or ssh. If you already have a remote called origin on your local machine, you might want to rename it first. Or you can call the gitlab one something different. Also if you want to push all your branches to gitlab you can do a git push --all origin If you want your tags, git push --tags origin

这篇关于如何使用CLI从现有的本地git仓库创建新的gitlab仓库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆