Skip to content

Update 'How to Create and store a Symfony2 Project in Git' #3827

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 27, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 27 additions & 26 deletions cookbook/workflow/new_project_git.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,51 +20,51 @@ Initial Project Setup
To get started, you'll need to download Symfony and initialize your local
git repository:

1. Download the `Symfony2 Standard Edition`_ without vendors.
#. Download the `Symfony2 Standard Edition`_ using Composer:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a sentence after this:

First, download Composer_: this will give you a composer.phar file.
Now, run the next command from anywhere on your system: it downloads a starting
Symfony project into a path/ directory (you can change this in the command):

I realize we have detailed installation details in multiple places, at some point we should consolidate. I just want to be very complete so a user can step through things.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps there should be one canonical article about using Composer? All other articles could reference to that article for more information about installing and using Composer.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, I think there should be :).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should leave it as it is right now. The article links to Installing Symfony using Composer where more information about using Composer can be found. It might be a good idea to create a dedicated article about Composer, but that should probably be another pull request.


2. Unzip/untar the distribution. It will create a folder called Symfony with
your new project structure, config files, etc. Rename it to whatever you like.

3. Create a new file called ``.gitignore`` at the root of your new project
(e.g. next to the ``composer.json`` file) and paste the following into it. Files
matching these patterns will be ignored by Git:

.. code-block:: text

/web/bundles/
/app/bootstrap*
/app/cache/*
/app/logs/*
/vendor/
/app/config/parameters.yml
.. code-block:: bash

.. tip::
$ php composer.phar create-project symfony/framework-standard-edition path/ ~2.3

You may also want to create a .gitignore file that can be used system-wide,
in which case, you can find more information here: `Github .gitignore`_
This way you can exclude files/folders often used by your IDE for all of your projects.
Composer will now download the Standard Distribution along with all of the
required vendor libraries. For more information about downloading Symfony using
Composer, see `Installing Symfony using Composer`_.

4. Initialize your Git repository:
#. Initialize your Git repository:

.. code-block:: bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is the case add the SymfonyRequirements class as sometimes is good to remove it or ignore it, same with config and check scripts 👶

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why you put that comment on this line. Besides that, I'm missing what you want to say. The files listed here are things that generally should be ignored, ignoring config/check scripts is something that doesn't belong in that list imo

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is more for more slim approaches, these files change anyway depending on the OS are are files that can be cleaned up

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR only changes the documentation to reflect the actual .gitignore. If you'd want to propose a change to the file, you should probably do it in the Symfony Standard Edition repository, not here.


$ git init

5. Add all of the initial files to Git:
#. Add all of the initial files to Git:

.. code-block:: bash

$ git add .

6. Create an initial commit with your started project:
.. tip::

As you might have noticed, not all files that were downloaded by Composer in step 1,
have been staged for commit by Git. Certain files and folders, such as the project's
dependencies (which are managed by Composer), ``parameters.yml`` (which contains sensitive
information such as database credentials), log and cache files and dumped assets (which are
created automatically by your project), should not be committed in Git. To help you prevent
committing those files and folders by accident, the Standard Distribution comes with a
file called ``.gitignore``, which contains a list of files and folders that Git should
ignore.

.. tip::

You may also want to create a ``.gitignore`` file that can be used system-wide.
This allows you to exclude files/folders for all your projects that are created by
your IDE or operating system. For details, see `Github .gitignore`_.

#. Create an initial commit with your started project:

.. code-block:: bash

$ git commit -m "Initial commit"

7. Finally, download all of the third-party vendor libraries by
executing Composer. For details, see :ref:`installation-updating-vendors`.

At this point, you have a fully-functional Symfony2 project that's correctly
committed to Git. You can immediately begin development, committing the new
changes to your Git repository.
Expand Down Expand Up @@ -111,6 +111,7 @@ manage this is `Gitolite`_.

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