Mee*_*ite 2 git recovery gitlab gitlab-ce
我们在服务器的虚拟机上安装了Gitlab CE。
这个Gitlab服务器上有3个人在一个存储库中工作。
这个Gitlab CE虚拟机已被意外删除!这3个人的本地存储库仍然有很多分支机构。
我们的分支策略是这样的:
每个用户都有一个Master分支和一些功能分支。
用户过去曾:
现在,我有一些问题:
在GitLab / BitBucket / GitHub中创建一个空的仓库。
使用新存储another库的URL在当前存储库中添加新的远程服务器(例如)。然后将master分支的提交/更改推送到another仓库的主分支。
$ git remote add another <new-repo-url>
$ git remote -v # see if the remote is added correctly
$ git checkout master
$ git push another master # push the changes to another/master
Run Code Online (Sandbox Code Playgroud)如果您需要另一个分支的功能(例如feature),则只需checkout转到该feature分支,然后将更改推送到another仓库的feature分支即可。
$ git checkout feature
$ git push another feature # push changes to 'another' repo's 'feature' branch
Run Code Online (Sandbox Code Playgroud)推动所有的branches和tags以another回购。
$ git push --all --tags another
Run Code Online (Sandbox Code Playgroud)注意:此处another代表您新仓库的URL。
| 归档时间: |
|
| 查看次数: |
2463 次 |
| 最近记录: |