如何推送 .gitignore 中指定的文件? [英] How do I push files specified in .gitignore?

查看:35
本文介绍了如何推送 .gitignore 中指定的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我的 .gitignore 中有一个供应商"目录,有没有办法可以设置一个遥控器,以便在我推送时接收该目录?

If I have a "vendors" directory in my .gitignore, is there a way I can set up a remote that will receive that directory anyway when I do a push?

推荐答案

我认为您正在寻找的功能可以通过一个用于部署到您的云提供商的分支来实现.

I think the functionality you're looking for can be achieved by having a branch used to deploy to your Cloud Provider.

设置一个包含你的 .gitignore 文件的 dev 分支,检查你的增量工作到那个分支.

Setup a dev branch which includes your .gitignore file, check your incremental work into that branch.

将您的 dev 分支合并到不包含 .gitignore 文件但包含供应商目录的 deploy 分支中.

Merge your dev branch into your deploy branch which doesn't contain a .gitignore file but contains the vendors directory.

完成合并后,从 deploy 分支推送到远程部署.

once you've completed your merge, push to the deployment remote from your deploy branch.

这篇关于如何推送 .gitignore 中指定的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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