Running a git project on my machine

Asked

Viewed 933 times

2

I put a Laravel project of my machine into git with git ignore default.

Then to use it on another PC I downloaded it from git from the command line and tried to install Composer:

composer install

But he didn’t install the . env and other things otherwise I’m wrong

Then I created a new project with the same name by CLI, then copied the project I downloaded from git and pasted over the new project and it worked.

I wanted to know if there is a way with less gambiarra to make it work, IE without creating a new project, download another git and copy and paste in each other

  • The only thing you need is the . env file, which you can copy from .env.example. What other things you need?

1 answer

1


No. gitignore you choose which file or folder, which will not be uploaded, when committing that file is not added and while pushing that file or folder is not uploaded, if you want it . env be sent remove from . gitignore, now this is not advised. The same situation applies to "/vendor", there is no need for you to send all these files if you can perform a Composer install after cloning the project.

  • When I run Composer install it does not add the . env in the local project

  • Composer is a tool for managing dependencies for PHP, when you run the "Composer install" command, it will install the dependencies. It will not add .env.. When you download the Laravel structure, for example version 5.5, a file named .env.example comes, but it is only when you download the structure. If you want . env to always come when cloning your project, remove it from the .gitignore. Now do not go up with any production data, it is very dangerous.

  • @lipesmile Did you understand the purpose of Poser ? You tested by removing . env from . gitignore ?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.