Skip to content

Commit 0cb9c3b

Browse files
committed
bug #3827 Update 'How to Create and store a Symfony2 Project in Git' (nicwortel)
This PR was merged into the 2.3 branch. Discussion ---------- Update 'How to Create and store a Symfony2 Project in Git' This pull request updates the cookbook article [How to Create and store a Symfony2 Project in Git](http://symfony.com/doc/current/cookbook/workflow/new_project_git.html#initial-project-setup). It started with [this question (and its answer by Wouter J) on Stack Overflow](http://stackoverflow.com/q/23437768/1001110). | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | all (or 2.3+) | Fixed tickets | n/a Commits ------- 3f3d886 Update the tip about the global .gitignore 1baf7e0 Remove dash 6fd5e52 Small improvement d9f72f9 Some refactoring of the article 083c1f5 Replace static version constraint (2.4.4) 32cee81 Small change in the wording 311f14b Replace numbered list items with # 6a19628 Indent the tip to be on the same level as the list item 34d61eb Update the complete 'Initial Project Setup' paragraph 011e0f0 Update .gitignore example
2 parents 3792fee + 3f3d886 commit 0cb9c3b

File tree

1 file changed

+27
-26
lines changed

1 file changed

+27
-26
lines changed

cookbook/workflow/new_project_git.rst

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,51 +20,51 @@ 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+
#. 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.
27-
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:
31-
32-
.. code-block:: text
33-
34-
/web/bundles/
35-
/app/bootstrap*
36-
/app/cache/*
37-
/app/logs/*
38-
/vendor/
39-
/app/config/parameters.yml
25+
.. code-block:: bash
4026
41-
.. tip::
27+
$ php composer.phar create-project symfony/framework-standard-edition path/ ~2.3
4228
43-
You may also want to create a .gitignore file that can be used system-wide,
44-
in which case, you can find more information here: `Github .gitignore`_
45-
This way you can exclude files/folders often used by your IDE for all of your projects.
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`_.
4632

47-
4. Initialize your Git repository:
33+
#. Initialize your Git repository:
4834

4935
.. code-block:: bash
5036
5137
$ git init
5238
53-
5. Add all of the initial files to Git:
39+
#. Add all of the initial files to Git:
5440

5541
.. code-block:: bash
5642
5743
$ git add .
5844
59-
6. Create an initial commit with your started project:
45+
.. tip::
46+
47+
As you might have noticed, not all files that were downloaded by Composer in step 1,
48+
have been staged for commit by Git. Certain files and folders, such as the project's
49+
dependencies (which are managed by Composer), ``parameters.yml`` (which contains sensitive
50+
information such as database credentials), log and cache files and dumped assets (which are
51+
created automatically by your project), should not be committed in Git. To help you prevent
52+
committing those files and folders by accident, the Standard Distribution comes with a
53+
file called ``.gitignore``, which contains a list of files and folders that Git should
54+
ignore.
55+
56+
.. tip::
57+
58+
You may also want to create a ``.gitignore`` file that can be used system-wide.
59+
This allows you to exclude files/folders for all your projects that are created by
60+
your IDE or operating system. For details, see `Github .gitignore`_.
61+
62+
#. Create an initial commit with your started project:
6063

6164
.. code-block:: bash
6265
6366
$ git commit -m "Initial commit"
6467
65-
7. Finally, download all of the third-party vendor libraries by
66-
executing Composer. For details, see :ref:`installation-updating-vendors`.
67-
6868
At this point, you have a fully-functional Symfony2 project that's correctly
6969
committed to Git. You can immediately begin development, committing the new
7070
changes to your Git repository.
@@ -111,6 +111,7 @@ manage this is `Gitolite`_.
111111

112112
.. _`Git`: http://git-scm.com/
113113
.. _`Symfony2 Standard Edition`: http://symfony.com/download
114+
.. _`Installing Symfony using Composer`: http://symfony.com/doc/current/book/installation.html#option-1-composer
114115
.. _`git submodules`: http://git-scm.com/book/en/Git-Tools-Submodules
115116
.. _`GitHub`: https://github.com/
116117
.. _`barebones repository`: http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository

0 commit comments

Comments
 (0)