git - 如何推送 .gitignore 中指定的文件?

标签 git gitignore git-push composer-php phpfog

如果我的 .gitignore 中有一个“vendors”目录,有没有办法设置一个在我执行推送时无论如何都会接收该目录的远程?

最佳答案

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

设置一个 dev 分支,其中包含您的 .gitignore 文件,将您的增量工作 checkin 该分支。

将您的 dev 分支 merge 到您的 deploy 分支中,该分支不包含 .gitignore 文件但包含 vendors 目录。

完成 merge 后,从您的 deploy 分支推送到远程部署。

关于git - 如何推送 .gitignore 中指定的文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11788229/

相关文章:

git - .gitignore 目录/通配符意外行为

ios - 当gitignore没有提及时,Git会忽略podfile

git - 推送到远程后,如何用新提交覆盖或替换提交?

git - 无法安装git flow

Git push 说 - 请求的 URL 返回错误 : 403 but with sudo - works

xcode - 如何修复错误 : pathspec 'git-practice-project/git-practice-project' did not match any file(s) known to git

git - "failed to lock"错误

git - 创建 merge 请求后,我还可以在分支上添加提交吗?

git - 使用 Git shell 列出本地和远程 Git 存储库

git push 在 HTTP/1.1 100 之后卡在(哑)https 上继续