与GIT和多个项目合作 [英] working with GIT and multiple projects

查看:47
本文介绍了与GIT和多个项目合作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我几乎在每个项目中都有一组核心文件,但是每个项目也都有自己的独特文件. 当我在一个项目上工作时,有时会更新这些核心文件,直到现在为止,我一直在不遗余力地将文件复制回主核心文件文件夹(每次启动新项目时都会对其进行复制). 另外,当一次处理几个项目时,我可能需要将一个核心文件更改复制到master文件夹和另一个项目中,这需要花费时间,并且可能难以跟踪!

I have a core set of files I use for almost every project, but each project also has its own unique files too. When i work on one project i sometime update these core files, until now I have been inelegantly copying the files back to the master core files folder ( which I make a copy of whenever I start a new project). Also when working on a couple of projects at once I may need to copy a core file change to both the master folder and the other project which takes time and can be difficult to keep track of!

我最近发现了GIT,我希望它可以解决我的全部或至少某些问题...

I have recently found GIT and I am hoping it can solve all or at least some of my problems...

因此,现在有了master文件夹,我可以对其进行分支以帮助更好地管理我的核心更新,然后在完善到master文件夹时将它们合并回去.很好

So I get that now with the master folder I can make branches off it to help manage my core updates better and then merge them back when perfected to the master. Great

但是任何人都可以帮助我解决如何处理多个项目并使所有核心文件在主文件和项目之间保持同步,而无需复制项目文件夹中的所有文件吗?

But can anyone help me out with how I can deal with my multiple projects and keeping all the core files in sync between master and projects without copying all the files in the project folder around?

我可以将分支拆分成新的回购协议,但仍可以跟踪更改的前后情况吗?

Can I break off a branch into a new repo but still track changes forward and back?

感谢任何提示,建议,指南或链接!

Any tips, advice, guides or links are appreciated!

推荐答案

一种可能性是,您将核心例程放入名为"core"或类似名称的存储库中,然后将其添加为

One possibility is that you put your core routines in a repository called "core" or something like that and then add that as a submodule to all your other projects.

这篇关于与GIT和多个项目合作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆