Ligonsker's avatar

After switching to an older git branch - route:list still shows the routes created by the new branch

Hi

I had a clean Laravel installation, I then checked out to a new branch, where I installed Jetstream. I then committed the changes and switched back to the branch where Jetstream was not installed on.

However when I run php artisan route:list, I still see all the routes created by Jetstream (login, register, etc..)

I ran php artisan route:clear but the routes are still there

I noticed that because the front page of the Laravel installation still had the "Log In" and "Register" links on top, which are shown only if the routes exist:

 @if (Route::has('login'))
 ...
@endif

Why?

0 likes
4 replies
MohamedTammam's avatar
Level 51

Because you vendor folder still contain the Jetstream package. delete that folder and run composer install, then you will not see it.

1 like
Snapey's avatar

@Ligonsker vendor should always be in .gitignore. Don't be tempted to change this.

When you switch branches, run composer install.

2 likes
Ligonsker's avatar

@Snapey Oh I'm definitely never going to put vendor there! It just went over my mind

Please or to participate in this conversation.