dongqiulei1987 2013-12-18 21:21
浏览 42
已采纳

将FOSUserBundle添加到项目git存储库

I use composer to install FOSUserBundle in Symfony2, I can't add the bundle to my project git repository.

I found in FOSUserBundle there has a .git directory and has its own config.

When I use git add -A always get "commit or discard the untracked or modified content in submodules".

Can you help to show how to add this bundle to my repository?

Thanks in advance.

  • 写回答

2条回答 默认 最新

  • duanjiong1952 2013-12-18 23:33
    关注

    You could do something like this:

    $ git add vendor/path/to/Bundle/*
    

    You could also create a git submodule of the User Bundle in the src/FOS/UserBundle/ directory.

    git submodule add <git@github ...> src/FOS/UserBundle
    

    If you are going to do this you shouldn't use composer to install this dependency.

    BUT Before you start adding third party bundles to your own repository ask the following questions:

    1. Do you need to modify/extend the default functionality of the Bundle?
    2. Do you need to fix a bug in the code?
    3. Do you need to re-write big chunks of the original code to fit your specific use case?

    If your answer to #1 is yes: You want to take a look at these resources

    The code you end up with will sit on top of the user bundle and it can go in your own repository.

    If your answer to #2 is yes:

    • Make sure it is really a bug (read the docs).
    • Create an issue on github.
    • Create a fork from the original repo.
    • Fix the bug in your fork.
    • Submit a pull request.

    See more information in the Contributing to a project section, and the Contribute Code for Symfony for general guidelines on how to contribute to projects.

    If your answer to #3 is yes:

    Create your own fork of the user bundle and work with that. Add the fork to your own project as a sub-module or create a packagist package that can be installed via composer.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥15 MCNP里如何定义多个源?
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services