dou72260 2017-04-08 08:28
浏览 24
已采纳

将更改从供应商目录推送到composer包的最快方法

I have a Laravel project and I'm using a composer. I have a library in it and I've found a small bug there. It's my custom library under the git.

What is the fastest way to push that changes?

The only way I see from now is to:

  • git clone my library to some temporary folder
  • Remember and copy-paste all the changes(cause I was fixing but in the /vendor dir)
  • Run composer update

Could be there any other, faster way? I'd like make changes right in the vendor dir and somehow push that changes.

P.S. As an answer I want to receive

No, it's impossible to do faster because of x, y, z.

or

Yes, you can. For that you have to do x, y, z.

  • 写回答

1条回答 默认 最新

  • doufei1988 2017-04-08 15:29
    关注

    Untested…

    Linux or macOS: Yes, you can. For that you have to do something like

    1. Store your new code somewhere else as backup:

      mv …/vendor/mylib/ …/vendor/mylib_backup/
      
    2. Optional: Delete your temp repo:

      rm -r ~/git/mylib/
      
    3. Clone your repo:

      git clone repo-url ~/git/mylib
      
    4. Create a symlink so that if you go into …/vendor/mylib you are really in ~/git/mylib:

      ln -s ~/git/mylib …/vendor/mylib
      
    5. Run

      composer update
      
    6. Run

      git status
      

    Maybe you get some artefacts. You can ignore them in a .gitignore file.

    Which system do you use? To create a symlink on Windows you can try mklink IIRC.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图2.0 版本点聚合中Marker的位置无法实时更新,如何解决呢?
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题