Search code examples
gitgit-svnmagento

Basic git workflow understanding


I have some basic git questions, which i do not understand yet I hope someone can help me. Lets say I'm working on a Magento project, I run it local but i want to bring it online. So i push my shop to my server using git. Everything works fine until Magento provides an update. So here is my question:

I make any changes in my local directory and git add + git commit them, but when i update my Magento Shop through Magento Connect from 1.7 to 1.7.1 I will have a different setup on my server then I have on my local computer, right?

So what do I have to do, do make them equal? Do I have to make a checkout from the version runed on my server and replace it with my local magento?


Solution

  • From a version control point of view you do not want to have your development environment and live environment on the same branch. For example you could use the master branch for your development and then have your live environment on a stable branch. There are also branch structures with multiple feature, release and hotfix branches. But lets keep it simple for now.

    Regarding updates. You never want to run them on a live environment directly. It's nearly impossible to do a rollback of the related DB changes. So always update and push your work upstream from dev to live instead of the other way around.

    So always do upgrades on your dev environment (thus master branch), and after testing commit them to your repository. Afterwards you can either merge or cherry-pick to the other branch. Afterwards update the live branch (i.e git pull or git fetch, git rebase) to deploy the upgrade.