合并代码更改时没有真正的源代码控制

时间:2023-01-18 23:26:12

We have a few developers working on the same VS2005 solution, but our source control is very bad. (Our company uses Harvest, which we give a vote of no confidence).

我们有一些开发人员在使用相同的VS2005解决方案,但我们的源代码控制非常糟糕。 (我们公司使用Harvest,我们投票不信任)。

Right now, we're all just working off of the files on a shared lan drive. Obviously, this causes some problems. But we think it's better than working locally, and tracking the files we touched in a spreadsheet and merging everything manually. Does anybody have a strategy for merging our changes?

现在,我们只是处理共享局域网驱动器上的文件。显然,这会导致一些问题。但我们认为这比在本地工作更好,并且跟踪我们在电子表格中触及的文件并手动合并所有内容。有没有人有合并我们的变化的策略?

Some of the problems exist because of corporate beaurocracy (like mandating Harvest). Those same policies prevent introducing new tools into our environment. So, strategies that avoid buying/downloading new software would work best for us.

存在一些问题是因为公司的*(如强制收获)。这些相同的政策阻止在我们的环境中引入新工具。因此,避免购买/下载新软件的策略最适合我们。

9 个解决方案

#1


5  

Treat the share as if it were your source control system. Make the share read-only, which will force developers to get local copies in order to make changes. You then have a somewhat stable version to compare against. This would help facilitate being able to do "merges". "Checking" code in would have to consist of some sort of backup strategy for the file (possibly making a copy of the file with a timestamp and username as part of the new file name) and replacing the original with the new version.

将共享视为源控制系统。使共享成为只读,这将迫使开发人员获取本地副本以进行更改。然后你有一个稍微稳定的版本来比较。这将有助于促进能够“合并”。 “检查”代码必须包含文件的某种备份策略(可能使用时间戳和用户名作为新文件名的一部分制作文件的副本)并将原始文件替换为新版本。

That being said, doing this type of activity without a real source control system that is reliable is going to be difficult and error-prone.

话虽这么说,在没有可靠的真实源控制系统的情况下进行这种类型的活动将是困难且容易出错的。

#2


6  

Learn to use Harvest. It takes a little effort to get things going smoothly but overall it is an excellent source control system.

学习使用Harvest。需要花费一点力气才能让事情顺利进行,但总的来说它是一个出色的源控制系统。

#3


6  

Another possibility would be Beyond Compare from Scooter. It has two and three way merge and great diff functionality on files and directories. If you want to know a little more about it, listen to the delphi podcast by Jim McKeith.

另一种可能性是Scooter的Beyond Compare。它在文件和目录上有两个和三个方式的合并和很棒的diff功能。如果您想了解更多信息,请听Jim McKeith的delphi播客。

But like most others I would recommend to either use Git or learn Harvest.If the source control system allows to change its diff application, Beyond Compare would be an excellent replacement.

但是和其他大多数人一样,我建议使用Git或者学习Harvest.If源控制系统允许改变它的差异应用程序,Beyond Compare将是一个很好的替代品。

#4


4  

Get git and install it locally on every dev's machine. Then set the repositories to replicate.

获取git并在每台开发者的机器上本地安装它。然后设置要复制的存储库。

#5


3  

There are two distinct issues: version control and merging. There's absolutely no excuse to NOT use a version control system. If the company has decided on a solution (for whatever reason), then use it. Not liking it or not "having confidence" in it is not a valid reason for not using it. And using a shared drive to mimic a source code control system is beyond crazy.

有两个不同的问题:版本控制和合并。绝对没有理由不使用版本控制系统。如果公司已决定解决方案(无论出于何种原因),请使用它。不喜欢它或不喜欢它“有信心”不是不使用它的正当理由。使用共享驱动器来模仿源代码控制系统是不可能的。

Merging is a second issue. You simply need a diff/merge tool. Pick one. How have you gone this long without one?!

合并是第二个问题。你只需要一个差异/合并工具。选一个。没有一个你怎么走这么久?!

Araxis is a great one. Costs a few bucks. The SourceGear folks have been freely distributing their diff/merge tool for some time (the one that comes with Vault). It's also a solid contender. Those are two that I've used that I know are still on the market now. There are others some already have mentioned.

Araxis是一个很棒的人。花费几美元。 SourceGear的人们已经在一段时间内*地分发他们的差异/合并工具(Vault附带的那个)。它也是一个坚实的竞争者。这两个是我用过的,我知道现在还在市场上。还有一些人已经提到了。

Merging everything by hand is not a tenable solution. Combining that with not using a VCS is a recipe for disaster.

手动合并一切都不是一个可靠的解决方案。将其与不使用VCS相结合是一种灾难。

#6


2  

You're probably going to have to download something unless you want to do it by hand. I highly recommend Winmerge. It's free, open source, and probably better for you a small download that doesn't mess things up.

你可能不得不下载一些东西,除非你想手工完成。我强烈推荐Winmerge。它是免费的,开源的,并且可能更适合您的小型下载,不会搞砸。

#7


2  

There is a standard unix command-line tool called merge that will fairly intelligently merge two sets of changes to a file. The syntax is:

有一个名为merge的标准unix命令行工具,可以相当智能地将两组更改合并到一个文件中。语法是:

merge mine older yours

Where "mine" is the file with your changes, "older" is the original file, and "yours" contains someone else's changes.

如果“我的”是您的更改文件,“旧”是原始文件,“您的”包含其他人的更改。

Not sure if you have a UNIX (or Mac OS X) box lying around to do this on though.

不确定你是否有一个UNIX(或Mac OS X)盒子可以执行此操作。

#8


2  

This might not be a viable option, but perhaps you could use a distributed system like bazaar, git, or Mercurial.

这可能不是一个可行的选择,但也许你可以使用像bazaar,git或Mercurial这样的分布式系统。

The reason I suggest these is that they are very low overhead and can be used with other systems. I know with bazaar the repository is simply a hidden folder added to the directory.

我建议这些的原因是它们的开销很低,可以和其他系统一起使用。我知道在bazaar中,存储库只是一个添加到目录中的隐藏文件夹。

#9


1  

Working off of a shared drive is not a good idea, and gets my vote of "no confidence".

使用共享驱动器不是一个好主意,并得到我的“不信任”投票。

It would be too easy to overwrite other's changes, you have no change tracking, no way to branch or tag/label, etc.

覆盖其他更改太容易了,没有变更跟踪,无法分支或标记/标记等。

#1


5  

Treat the share as if it were your source control system. Make the share read-only, which will force developers to get local copies in order to make changes. You then have a somewhat stable version to compare against. This would help facilitate being able to do "merges". "Checking" code in would have to consist of some sort of backup strategy for the file (possibly making a copy of the file with a timestamp and username as part of the new file name) and replacing the original with the new version.

将共享视为源控制系统。使共享成为只读,这将迫使开发人员获取本地副本以进行更改。然后你有一个稍微稳定的版本来比较。这将有助于促进能够“合并”。 “检查”代码必须包含文件的某种备份策略(可能使用时间戳和用户名作为新文件名的一部分制作文件的副本)并将原始文件替换为新版本。

That being said, doing this type of activity without a real source control system that is reliable is going to be difficult and error-prone.

话虽这么说,在没有可靠的真实源控制系统的情况下进行这种类型的活动将是困难且容易出错的。

#2


6  

Learn to use Harvest. It takes a little effort to get things going smoothly but overall it is an excellent source control system.

学习使用Harvest。需要花费一点力气才能让事情顺利进行,但总的来说它是一个出色的源控制系统。

#3


6  

Another possibility would be Beyond Compare from Scooter. It has two and three way merge and great diff functionality on files and directories. If you want to know a little more about it, listen to the delphi podcast by Jim McKeith.

另一种可能性是Scooter的Beyond Compare。它在文件和目录上有两个和三个方式的合并和很棒的diff功能。如果您想了解更多信息,请听Jim McKeith的delphi播客。

But like most others I would recommend to either use Git or learn Harvest.If the source control system allows to change its diff application, Beyond Compare would be an excellent replacement.

但是和其他大多数人一样,我建议使用Git或者学习Harvest.If源控制系统允许改变它的差异应用程序,Beyond Compare将是一个很好的替代品。

#4


4  

Get git and install it locally on every dev's machine. Then set the repositories to replicate.

获取git并在每台开发者的机器上本地安装它。然后设置要复制的存储库。

#5


3  

There are two distinct issues: version control and merging. There's absolutely no excuse to NOT use a version control system. If the company has decided on a solution (for whatever reason), then use it. Not liking it or not "having confidence" in it is not a valid reason for not using it. And using a shared drive to mimic a source code control system is beyond crazy.

有两个不同的问题:版本控制和合并。绝对没有理由不使用版本控制系统。如果公司已决定解决方案(无论出于何种原因),请使用它。不喜欢它或不喜欢它“有信心”不是不使用它的正当理由。使用共享驱动器来模仿源代码控制系统是不可能的。

Merging is a second issue. You simply need a diff/merge tool. Pick one. How have you gone this long without one?!

合并是第二个问题。你只需要一个差异/合并工具。选一个。没有一个你怎么走这么久?!

Araxis is a great one. Costs a few bucks. The SourceGear folks have been freely distributing their diff/merge tool for some time (the one that comes with Vault). It's also a solid contender. Those are two that I've used that I know are still on the market now. There are others some already have mentioned.

Araxis是一个很棒的人。花费几美元。 SourceGear的人们已经在一段时间内*地分发他们的差异/合并工具(Vault附带的那个)。它也是一个坚实的竞争者。这两个是我用过的,我知道现在还在市场上。还有一些人已经提到了。

Merging everything by hand is not a tenable solution. Combining that with not using a VCS is a recipe for disaster.

手动合并一切都不是一个可靠的解决方案。将其与不使用VCS相结合是一种灾难。

#6


2  

You're probably going to have to download something unless you want to do it by hand. I highly recommend Winmerge. It's free, open source, and probably better for you a small download that doesn't mess things up.

你可能不得不下载一些东西,除非你想手工完成。我强烈推荐Winmerge。它是免费的,开源的,并且可能更适合您的小型下载,不会搞砸。

#7


2  

There is a standard unix command-line tool called merge that will fairly intelligently merge two sets of changes to a file. The syntax is:

有一个名为merge的标准unix命令行工具,可以相当智能地将两组更改合并到一个文件中。语法是:

merge mine older yours

Where "mine" is the file with your changes, "older" is the original file, and "yours" contains someone else's changes.

如果“我的”是您的更改文件,“旧”是原始文件,“您的”包含其他人的更改。

Not sure if you have a UNIX (or Mac OS X) box lying around to do this on though.

不确定你是否有一个UNIX(或Mac OS X)盒子可以执行此操作。

#8


2  

This might not be a viable option, but perhaps you could use a distributed system like bazaar, git, or Mercurial.

这可能不是一个可行的选择,但也许你可以使用像bazaar,git或Mercurial这样的分布式系统。

The reason I suggest these is that they are very low overhead and can be used with other systems. I know with bazaar the repository is simply a hidden folder added to the directory.

我建议这些的原因是它们的开销很低,可以和其他系统一起使用。我知道在bazaar中,存储库只是一个添加到目录中的隐藏文件夹。

#9


1  

Working off of a shared drive is not a good idea, and gets my vote of "no confidence".

使用共享驱动器不是一个好主意,并得到我的“不信任”投票。

It would be too easy to overwrite other's changes, you have no change tracking, no way to branch or tag/label, etc.

覆盖其他更改太容易了,没有变更跟踪,无法分支或标记/标记等。