2

Hello Guy i am New to mangeto technology , i have created a small E commerce website using Mangeto ON WAMP, it's very simple website and now i planning to put it on Git or any other version control so that if anyone fellow developer want to make changes in website then they can, Now my Problem here is as follows

1.should i upload the entire Magento folder or there some specific files from the folder ?

  1. i will need the database too, which i have created for website using phpMyadmin how to deal with that ?

3.once i am done with uploading Mangento and getting database too , what should i do that it work fine on other system?

3 Answers 3

0

So, let’s begin. First of all, I assume that you wish to start with fresh project and that you’ll be doing only back-end programming. This is important because I’ll set up repository only for /app/code/local/ folder. It will keep the repository lightweight and enough for this practical example. At the end, I’ll explain .gitignore file so that you can make modifications to folders you wish to include.

Preparing Git locally

There are two steps you must go through before you start working with Git:

To get started, you need to install Git on your machine – you can find instructions by going on this page. Next thing you need to do is to find yourself a Git repository that you’ll use for your projects. For this example, I used free private repository located .

Registering (and auto-configuring) of Git repository is extremely simple with gitfarm.appspot.com

Adding Magento files to Git repository

Now, when you have your repository ready, all we need to do is add our files to it. In my example, I’ll add only 1 Magento directory (/app/code/local/) I accomplished that with following commands:

  1. Navigate to your “workspace” directory
  2. Write to console: git clone http://[email protected]/git/repository_name.git – we cloned our empty repository to local machine
  3. Navigate to directory named “repository_name” and if you see .git directory inside it, copy your Magento project inside it
  4. Write to console: git add app/code/local/ – this line added our first directory with its files to repository
  5. Write to console: git commit -a -m “Initial repository setup” – with this line executed, we made our first commit with message “Initial repository setup”
  6. Write to console: git push http://[email protected]/git/repository_name.git master – and finally we pushed our initial setup folder to repository. When this command is executed, you’ll have your files online in this example.

Now, that wasn’t so hard you should agree. At the moment if you followed these few steps, you have your first Magento Git repository ready for work.

At the moment, anyone with repository location (and password in case of gifarm) can repeat steps 1. , 2. ,5. and 6. and do his/hers share on the project.

Notes:

If you haven’t used gitfarm.appspot.com as your repository, steps 2 and 6 might differ (depending of repository setup) if you’ve used any private repository, you will have to authenticate via password or ssh key (depending on setup) – when promited in any of the steps You can add more than one directory to your Git repository by repeating step 4 with different location (all files and folders under that directory will be added) .gitignore and Magento

.gitignore is Git file that contains a list of files/folders that you wish to keep untracked on repository itself. So, on Magento, as in any other project those are files and folders that depend on your local setup like downloader/, errors/, config.xml,… and so on.

0
  1. There are some files that you may not need to include in your git repository such as the /var/log, /var/report, /var/cache, /var/session files. You can easily find some .gitignore files for Magento projects. Here is one of them by Inchoo.net.
    1. For the database, one solution would be to use Ant to fastly and easily re-deploy the environment. Its job is to relaunch the installation of Magento in background
0

Whenever you are pushing code to github you need to make sure that below files are not incluided

  • /app/etc/local.xml
  • /media folder ( For small catalog its fine but not god for huge catalog)
  • /var/*
  • /tmp ( if its created )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.