如何在 Git 中使用 Altium?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5121233/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 10:12:38  来源:igfitidea点击:

How to use Altium with Git?

gitsvnaltium-designer

提问by Hymannad

Altium has built in support for Subversion but we do have a need for version control at multiple sites. WANdisco can synchronize multiple SVN repositories but it is expensive. Has anyone used Altium with Git? If so, how?

Altium 内置了对 Subversion 的支持,但我们确实需要在多个站点进行版本控制。WANdisco 可以同步多个 SVN 存储库,但价格昂贵。有人在 Git 上使用过 Altium 吗?如果是这样,如何?

采纳答案by Eric Anderson

I recently re-raised this question with Altium and got the following reply:

我最近用 Altium 重新提出了这个问题,得到了以下答复:

Eric Anderson, good question! I am sorry to say that there is only support for SVN and CVS as you were aware. I have not heard of any future plans for the other storage/version control software packages. The only thing that comes to mind is to use the built in SVN and in the "working directory" try adding that to Git (or others) and do the commits/updates external from Altium.

I can also suggest going onto AltiumLive and into Ideas section and enter an idea. If enough people like it and vote for it the possibility for implementation exists (no promises of course).

埃里克·安德森,好问题!很抱歉,正如您所知,仅支持 SVN 和 CVS。我还没有听说其他存储/版本控制软件包的任何未来计划。唯一想到的是使用内置的 SVN 并在“工作目录”中尝试将其添加到 Git(或其他)并从 Altium 外部执行提交/更新。

我还可以建议进入 AltiumLive 并进入 Ideas 部分并输入一个想法。如果有足够多的人喜欢它并投票支持它,则存在实施的可能性(当然没有承诺)。

AltiumLive ideas is at http://bugcrunch.live.altium.com/#Ideas/Newif anyone feels like commenting there.

AltiumLive 的想法在http://bugcrunch.live.altium.com/#Ideas/New如果有人想在那里发表评论。

回答by Hymannad

The answer I eventually got from Altium was "what is git?" I took that as a "don't try it."

我最终从 Altium 得到的答案是“什么是 git?” 我认为这是“不要尝试”。

回答by Jason Kotzin

I recently got this working. I'm using a private repo on github, so I unfortunately can't show proof. But here is how to do it, I hope this helps others as it took me a few hours to figure it out. Note, there should be nothing special about using github, they are probably using the git-svn as Paul mentioned.

我最近开始工作了。我在 github 上使用了一个私有仓库,所以很遗憾我无法提供证据。但这是如何做到的,我希望这对其他人有所帮助,因为我花了几个小时才弄明白。请注意,使用 github 应该没有什么特别之处,他们可能正在使用 Paul 提到的 git-svn。

I'm using the 'built in version' of SVN under Altium Version Control preferences. I do have tortoise svn installed, although that's just so I can use some of the GUI features. (I'm using tortoise 1.8.5, which seems to work fine with github).

我在 Altium 版本控制首选项下使用 SVN 的“内置版本”。我确实安装了 tortoise svn,虽然这只是为了我可以使用一些 GUI 功能。(我使用的是乌龟 1.8.5,它似乎与 github 一起工作正常)。

Here is the thing that got me stuck... For SVN to work, you CAN NOT have an empty repo, you have to have at least one commit. So assuming you are on github, start a repo, and then follow the instructions they give. (just so the repo is not empty):

这是让我陷入困境的事情......要使 SVN 工作,你不能有一个空的仓库,你必须至少有一个提交。所以假设你在 github 上,启动一个 repo,然后按照他们给出的说明进行操作。(只是为了 repo 不是空的):

touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin [email protected]:flirc/altium.git
git push -u origin master

Now go to Altium, Preferences->Data Management->Design Repositories

现在转到 Altium,首选项-> 数据管理-> 设计存储库

Then click "connect to" SVN. A dialog should appear. The name is just a local reference so you can distinguish the server if you have multiple.

然后点击“连接到”SVN。应该会出现一个对话框。该名称只是一个本地引用,因此如果您有多个服务器,您可以区分服务器。

For github, and my example above:

对于 github,以及我上面的示例:

  • Method: https
  • Server: github.com
  • Server Port: Default
  • Repository Sub Folder: /flirc/altium
  • 方法:https
  • 服务器:github.com
  • 服务器端口:默认
  • 存储库子文件夹:/flirc/altium

It should be able to connect, and you should be able to seamlessly use SVN in Altium now. Seems to be working great so far. Hope that helps.

它应该能够连接,您现在应该可以在 Altium 中无缝使用 SVN。到目前为止似乎工作得很好。希望有帮助。

回答by Paul Evans

Have a look at git-cvsserver it's a a CVS server emulator for git. It appears to offer the pserver protocol directly to a cvs client. It's doesn't support watches though..

看看 git-cvsserver 它是一个用于 git 的 CVS 服务器模拟器。它似乎直接向 cvs 客户端提供 pserver 协议。虽然它不支持手表..

-Paul

-保罗

回答by zewill

THIS ISN'T A QUESTION ABOUT PROGRAMMING.I'll answer but don't worry if someone delete the question.

这不是关于编程的问题。我会回答,但如果有人删除了问题,请不要担心。



GOOD NEWS!

好消息!

Altium added support to Git control version like you can see in the Release Notes for Altium Designer.

Altium 添加了对 Git 控制版本的支持,就像您在Altium Designer发行说明中看到的那样。

To know how to use you can follow this Using Version Controlguide.

要了解如何使用,您可以遵循此使用版本控制指南。

回答by David Cary

It sounds like you have multiple SVN respositories, and you want some kind of distributed version control.

听起来您有多个 SVN 存储库,并且您想要某种分布式版本控制。

Have you considered using a distributed version control client that supports SVN repositories, such as TortoiseHgor SVKor SmartGitor git-svn ?

您是否考虑过使用支持 SVN 存储库的分布式版本控制客户端,例如TortoiseHgSVKSmartGit或 git-svn ?

Such clients cannot do everythingthat a client working with a repository designed for DVCS can do, but perhaps it will be better than what you have now.

这样的客户端无法完成使用为 DVCS 设计的存储库的客户端可以做的所有事情,但也许它会比您现在拥有的更好。

回答by sa_leinad

You can always use GIT outside of Altium - I have been doing so for many years.

您始终可以在 Altium 之外使用 GIT - 我已经这样做了很多年了。

Simply create a GIT repo based on your project folder.

只需根据您的项目文件夹创建一个 GIT 存储库。

On the downside, you do lose the functionality of Altium showing the differences between versions. Also, as far as I know, you can't do merges as the files Altium uses are not text based.

不利的一面是,您确实失去了 Altium 的功能,显示了版本之间的差异。此外,据我所知,您不能进行合并,因为 Altium 使用的文件不是基于文本的。

Edit:Altium are currently working to implement GIT as a version control option. https://bugcrunch.live.altium.com/#Idea/2379

编辑:Altium 目前正在努力将 GIT 实现为版本控制选项。https://bugcrunch.live.altium.com/#Idea/2379