简体   繁体   English

最好如何在同一个git repo中同时使用Xcode和Visual Studio?

[英]How best to use both Xcode and Visual Studio with the same git repo?

Apologies for a newbie question. 道歉的新手问题。 I'm setting up a code repository and project(s) for my company; 我正在为我的公司设置代码存储库和项目。 ultimately I'll be bringing on more experienced programmers than I - but I want to do sensible things from the ground up. 最终,我将聘请比我更有经验的程序员-但我想从头开始做明智的事情。

I've been working on a c++ library project in Visual Studio, with a git repository. 我一直在使用git存储库在Visual Studio中研究c ++库项目。 VS is a nice development environment but I'd also like to work on my mac (and deploy for the mac). VS是一个不错的开发环境,但我也想在Mac上工作(并为Mac部署)。

I like the fact that my VS Project is all set up with different configurations for debug builds etc etc - it really makes compilation etc very easy. 我喜欢这样的事实,我的VS Project都针对调试版本等设置了不同的配置-这确实使编译等非常容易。 Git of course is now supported by VS so I can manage my repo from within the same interface. VS当然现在支持Git,因此我可以在同一界面中管理我的仓库。 I'd like to be able to do the same on my mac with an Xcode Project. 我希望能够在Mac上使用Xcode项目执行相同的操作。

Questions: 问题:

  1. Is this sensible? 这明智吗?
  2. Is it done routinely, or is there a better way of achieving what I'm after? 它是按常规进行的,还是有一种更好的方法来实现我所追求的目标?
  3. Assuming 1. and 2. don't establish me as a loony, how do I do it? 假设1.和2.不能使我成为疯子,我该怎么做?
    • specifically, in Xcode I can't 'create a new project under source control' without creating an entirely new git repository. 具体来说,在Xcode中,如果不创建全新的git存储库,就无法“在源代码控制下创建新项目”。 I need to create a new project, under source control - but using an existing git repo. 我需要在源代码控制下创建一个新项目-但要使用现有的git repo。 Can someone help with the steps to set this up please? 有人可以协助您进行设置吗?

I'd be grateful for any comments on the subject of multiple projects on the same source, or of course more specific answers. 对于在同一来源的多个项目的任何评论,或者更具体的答案,我将不胜感激。

Thanks, 谢谢,

Tom 汤姆

  1. It is indeed very sensible to use the same source control for both types of projects. 在两种类型的项目中使用相同的源代码控制确实是非常明智的。

  2. Yes, I'm sure it is. 是的,我确定是。 I'm using git both at work and for my hobby projects at home. 我在工作中和在家中的业余项目中都使用git。

I'm pretty sure that both MS and Apple tools are also able to interact with an existing git repository. 我非常确定,MS和Apple工具也都可以与现有的git存储库进行交互。 You may well have to manually build the project in the respective tools - but this is simply because "Create new project" is really not meant for when you already have a bunch of source-files in the first place. 您可能必须在相应的工具中手动构建项目-但这仅仅是因为“开始创建新项目”实际上并不适合您已经拥有大量源文件的情况。

For a larger project with many different parts, you will probably also want to have several project files that use the same source files, so you will need to somehow manage these things in a way that doesn't involve just clicking a few places. 对于具有许多不同部分的较大项目,您可能还希望有几个使用相同源文件的项目文件,因此您将需要以某种方式管理这些内容,而不仅仅是单击几个位置。 But once you have built your project definition files for the respective IDE, it should be perfectly fine to store all your source and project definitions in a git repo. 但是,一旦为相应的IDE构建了项目定义文件,就可以将所有源代码和项目定义存储在git仓库中,这是完全可以的。

And yes, you want a single repo for all (or as much as you can of the) related source - otherwise you will need to keep track of, for example, which version of your project X goes with which version of test Y (because ultimately, you will update X to work differently, so test Y will need to be changed simultaneously - much easier to do that if you have one version control repo than if you have, say, your testcode in one repo and the production code for project X in another repo - it is generally hard enough to do these things with a single repo!). 是的,您想要所有(或尽可能多)相关源的单个仓库-否则,您将需要跟踪例如项目X的哪个版本与测试Y的哪个版本(因为最终,您将更新X使其工作方式不同,因此需要同时更改测试Y-如果您只有一个版本控制存储库,则比做一个版本控制库中的测试代码和项目的生产代码要容易得多X在另一个仓库中-通常很难通过一个仓库来完成这些事情!)

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

相关问题 如何使 Visual Studio 远程调试器 2017 和 2019 都在同一台计算机上工作? - How to make Visual studio Remote debugger 2017 and 2019 both work on a same computer? Visual Studio从同一项目制作静态库和dll - visual studio making both static library and dll from same project Visual Studio Code和Visual Studio使用相同的编译器吗? - Do Visual Studio Code and Visual Studio use the same compiler? 完全相同的C ++代码在Visual Studio中工作,但在Xcode中不起作用 - Exact same C++ Code works in Visual Studio but not in Xcode opengl,如何用visual studio更新标题? - opengl, how to best update headers with visual studio? 如何在Visual Studio中使用makefile? - How to use makefiles in Visual Studio? 如何在 Visual Studio 中使用 GoogleMock? - How to use GoogleMock in Visual Studio? 如何在 Visual Studio 中使用 libpng? - How to use libpng in Visual Studio? 如何在Visual Studio中打开fstream进行读写操作 - how to open fstream for both reading and writing operation in Visual Studio 使用 Git 处理 C++ Visual Studio 2019 解决方案的外部依赖源代码控制的最佳方法是什么? - What is the best way to handle source control of an external dependency for a C++ Visual Studio 2019 Solution using Git?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM