在Git的分支机构之间共享文件 [英] Sharing files across branches in Git

查看:381
本文介绍了在Git的分支机构之间共享文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目中有很多文件有时会被修改,但总是在许多不同的分支中共享。例子包括构建脚本,包含路径的批处理文件等,甚至.gitignore文件本身就是一个例子。



我想在源码控制中使用这些东西, t希望各个分支机构跟踪他们的变化。



您如何处理这种情况?

你在Git中跟踪与你的项目相关的所有内容?共享对象的方法是什么?



是.gitignore是我唯一的选择吗?

解决方案

将您的构建脚本和批处理文件保存在单独的回购站中?


There are a bunch of files in my project that are sometimes modified but always shared among many different branches. Examples include build scripts, batch files that include paths, etc. Even the .gitignore file itself is an example.

I want this stuff in source control, but I don't want individual branches to keep track of changes to them.

How do you handle this situation?

Do you track everything related to your project in Git? What's your approach to shared objects?

Is .gitignore my only option?

解决方案

Keep your build scripts and batch files in a separate repo?

这篇关于在Git的分支机构之间共享文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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