PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, January 22, 2022

[FIXED] The fastest way to push changes from vendor directory to composer package

 January 22, 2022     composer-php, git, github, laravel-5, php     No comments   

Issue

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.


Solution

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.



Answered By - qräbnö
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing