简体   繁体   English

git cvsimport:“远程”是指什么?

[英]git cvsimport: what does 'remote' refer to?

i copied files from old cvs repo locally. 我从本地CVS回购中复制了文件。 when i do 当我做

git cvsimport -C . -d path-to-cvs-folder some-module

it creates a git repo with branches so then i can push the whole repo into github: 它创建了一个带有分支的git repo,因此我可以将整个repo推送到github:

git push --mirror git@github.com:xxx.git

but the cvsimport creates master branch and also origin branch pointing to the same commit as master . 但是cvsimport创建master分支,也创建指向与master相同的提交的origin分支。 there are no remotes created: git remote -v returns nothing 没有创建任何远程: git remote -v返回任何内容

the question is: what is the purpose of the origin branch? 问题是: origin分支的目的是什么? in the manual there is -r switch to let me name that branch. 手册中有-r开关,让我命名该分支。 but what for? 但是为什么呢? there is no remote repo at the of migration - just locally copied cvs files. 迁移时没有远程仓库,只有本地复制的cvs文件。 what's the idea behind it? 它背后的想法是什么?

I have never used git cvsimport but it is clear from the documentation that it can be used incrementally, ie, you can import some CVS repository, then later import any changes since the previous import. 我从未使用过git cvsimport但是从文档中可以明显看出它可以增量使用,即,您可以导入一些CVS存储库,然后在以后导入自上次导入以来的所有更改 The -r switch and the names created from it are clearly intended for cvsimport's own internal use: when you do an incremental import, cvsimport uses something(s) stored in the origin branch(es) (or whatever name you choose here) to allow it to import only new changesets deduced by cvsps . -r开关及其中创建的名称显然是供cvsimport自己内部使用的:当您进行增量导入时,cvsimport使用存储在origin分支中的某些内容(或您在此处选择的任何名称)来允许它仅导入cvsps推导的变更集。

As the documentation says: 文档所述

If you are performing a one-shot import of a CVS repository consider using cvs2git or cvs-fast-export. 如果要一次性导入CVS存储库,请考虑使用cvs2git或cvs-fast-export。

These do not need special branches containing whatever it is that cvsimport stores there. 这些不需要特殊的分支,包含cvsimport在那里存储的内容。 They won't create an origin name that kind of gets in the way when you want to create a remote named origin . 他们不会创建一个origin的名字,当你想创建一个远程命名那种碍事origin

(Incidentally, Git is just fine with having both a branch named origin , and a remote named origin . Remote-tracking names live in the refs/remotes/ namespace while branch names live in the refs/heads/ namespace, so these will never collide; and the remote names themselves live only in the configuration file. It's only the shortened names, like origin/master , that Git uses for human convenience and comprehension that collide here. But this is very confusing to humans, who want to use the shortened names.) (顺便说一句, Git可以同时拥有一个名为origin分支和一个远程命名origin 。这都很好。远程跟踪名称位于refs/remotes/命名空间中,而分支名称位于refs/heads/命名空间中,因此它们永远不会冲突;和远程名称本身仅存在于配置文件中,Git为方便和理解而使用的只是缩写名称(如origin/master ,但这对想使用缩写名称的用户来说非常混乱。名称。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM