Skip to content

Commit 34d61eb

Browse files
committed
Update the complete 'Initial Project Setup' paragraph
As proposed by WouterJ in #3827 this commit rewrites the 'Initial Project Setup' paragraph. The documentation now describes the recommended way of creating a new Symfony2 project, using Composer to download the Standard Distribution + vendors (instead of downloading the zipped version). As the Standard Edition already contains a .gitignore, the example is replaced by a link to the one stored at GitHub. The article also explains which files are excluded by .gitignore. The last step (downloading vendor libraries using Composer) is removed as this is now covered by step 1.
1 parent 011e0f0 commit 34d61eb

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

cookbook/workflow/new_project_git.rst

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,56 +20,55 @@ Initial Project Setup
2020
To get started, you'll need to download Symfony and initialize your local
2121
git repository:
2222

23-
1. Download the `Symfony2 Standard Edition`_ without vendors.
23+
1. Download the `Symfony2 Standard Edition`_ using Composer:
2424

25-
2. Unzip/untar the distribution. It will create a folder called Symfony with
26-
your new project structure, config files, etc. Rename it to whatever you like.
25+
.. code-block:: bash
26+
27+
$ php composer.phar create-project symfony/framework-standard-edition path/ 2.4.4
2728
28-
3. Create a new file called ``.gitignore`` at the root of your new project
29-
(e.g. next to the ``composer.json`` file) and paste the following into it. Files
30-
matching these patterns will be ignored by Git:
29+
Composer will now download the Standard Distribution along with all of the
30+
required vendor libraries. For more information about downloading Symfony using
31+
Composer, see `Installing Symfony using Composer`_.
3132

32-
.. code-block:: text
33+
2. Your project folder will now contain files of the Symfony framework, as well
34+
as files and folders for vendor libraries. You'll want to store your project
35+
files in Git, but not the dependencies, since they will be managed by Composer.
36+
You'll also want to keep your ``parameters.yml`` out of your repository as it will
37+
contain sensitive information, such as database credentials. Furthermore,
38+
files that are automatically created by Symfony (such as logs, caches, and dumped
39+
assets) should be excluded as well.
3340

34-
/web/bundles/
35-
/app/bootstrap.php.cache
36-
/app/cache/*
37-
/app/config/parameters.yml
38-
/app/logs/*
39-
!app/cache/.gitkeep
40-
!app/logs/.gitkeep
41-
/build/
42-
/vendor/
43-
/bin/
44-
/composer.phar
41+
To help you keep these files out of your repository, Symfony comes with a file
42+
called ``.gitignore``. It contains a list of files and folders that Git will
43+
ignore.
44+
45+
The contents of the ``.gitignore`` file that comes with the Standard Distribution
46+
can be found in the `GitHub repository`_.
4547

4648
.. tip::
4749

4850
You may also want to create a .gitignore file that can be used system-wide,
4951
in which case, you can find more information here: `Github .gitignore`_
5052
This way you can exclude files/folders often used by your IDE for all of your projects.
5153

52-
4. Initialize your Git repository:
54+
3. Initialize your Git repository:
5355

5456
.. code-block:: bash
5557
5658
$ git init
5759
58-
5. Add all of the initial files to Git:
60+
4. Add all of the initial files to Git:
5961

6062
.. code-block:: bash
6163
6264
$ git add .
6365
64-
6. Create an initial commit with your started project:
66+
5. Create an initial commit with your started project:
6567

6668
.. code-block:: bash
6769
6870
$ git commit -m "Initial commit"
6971
70-
7. Finally, download all of the third-party vendor libraries by
71-
executing Composer. For details, see :ref:`installation-updating-vendors`.
72-
7372
At this point, you have a fully-functional Symfony2 project that's correctly
7473
committed to Git. You can immediately begin development, committing the new
7574
changes to your Git repository.
@@ -116,6 +115,8 @@ manage this is `Gitolite`_.
116115

117116
.. _`Git`: http://git-scm.com/
118117
.. _`Symfony2 Standard Edition`: http://symfony.com/download
118+
.. _`Installing Symfony using Composer`: http://symfony.com/doc/current/book/installation.html#option-1-composer
119+
.. _`GitHub repository`: https://github.com/symfony/symfony-standard/blob/master/.gitignore
119120
.. _`git submodules`: http://git-scm.com/book/en/Git-Tools-Submodules
120121
.. _`GitHub`: https://github.com/
121122
.. _`barebones repository`: http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository

0 commit comments

Comments
 (0)