使用 ac2git,然后使用 bitbucket

Using ac2git followed by bitbucket

我正在使用 ac2git 将我的 accurev depot 转换为 git 存储库。我能够成功进行转换,但是当我在创建新存储库后按照步骤操作时,我无法推送代表现在提交的 accurev 事务的更改。

我的意思是我丢失了历史记录,当我检查 bitbucket 上的提交选项时,我只能看到 hist 和 diff 文件。

我遵循了以下步骤:

python ac2git.py
cd existing-project
git add --all
git commit -m "Initial Commit"
git remote add origin http://****@bitbucket.******.git
git push -u origin master

我是 bitbucket 的新手,所以我不确定问题出在哪里?有人试过这个accurev->git->bitbucket吗?

换句话说,如何将我在本地创建的 git 存储库移动到 bitbucket 上的新存储库?

您的第一步是在 BitBucket 中创建存储库。那么您只需按照 BitBucket 的说明操作即可:

cd /path/to/my/repo
git remote add origin http://****@bitbucket.******.git
git push -u origin --all # pushes up the repo and its refs for the first time
git push origin --tags # pushes up any tags

我不是 100% 确定这就是发生的事情,但值得注意的是 ac2git 脚本在 refs/ac2git/* refs 下存储了大量元数据,包括一个 refs,它将在每个流的事务的提交历史记录中存储 hist.xmlstreams.xmldiff.xml。请参阅 how_it_works.md,其中解释了 refs/ac2git/depots/<depot_number>/streams/<stream_number>/info

尽管此 ref 充当分支,但不应通过调用 git push origin -u -all 将其上推,因为文档声称这只会将内容推送到 refs/heads/ 下。但是,如果出现错误,脚本可能无法正确签出已转换的分支,并且它可能会使您的本地存储库处于 detached HEAD 状态,在该状态下它实际上会签出内部分支之一参考

我不知道 git push origin -u --all 在这种情况下对于全新的 Bitbucket 存储库会做什么,但如果它已将您的 HEAD 引用推送到存储库,那么您将在远程获取此元数据。

但是,目前这只是一种理论,希望有人能够使用这些信息为您拼凑出更清晰的解决方案。