Using git for symfony projects


If you finally decided to use version control software for your current symfony project this small article is for you. We use git and want to share some information about it with you.

So first of all you’ll have to install it:

1. wget (of course number of version most probably will be changed so use git-x.x.x.x.tar.gz)
2. tar xzf git-
3. ./configure
4. make
5. make install

Please use the following use(r)ful sources about git to know what to do with it now:

Now b/c of you use it for symfony project you’d have to use the following simple script which we found in other article (please see here for full source):

I forgot numerous time to do a “./symfony clear:cache” after a “git pull”. Here is 2 easy steps to do it automatically:

Step 1: Create a file .git/hooks/post-merge which contains:

# An example hook script that is called after a git pull is made
# To enable this hook, make this file executable.

# simply do a ./symfony cc after each git-pull
exec “$GIT_DIR”/../symfony cc

Step 2:Then make it executable

chmod +x .git/hooks/post-merge

When you do a git-pull, it will do a “./symfony cc”

And here are some other sources regarding using of git with symfony projects:

Have a fun!

5 replies on “Using git for symfony projects”

What I’d like to know is how you handle the non-existant externals definitions of Subversion in git?

That’s probably the one thing that’s still holding me back to use git in Symfony projects.

Thanks for the great article! 🙂 Cheers, Daniel

I have the problem that empty directories can’t be committed. How do you deal with it?

Leave a Reply

Your email address will not be published. Required fields are marked *