0

I cloned Drupal 8 core and modules from my Acquia Cloud distro into my local repo.

In my local repo I have 2 branches * developand master. Currently I am in develop branch. I made some small changes to the .gitignore file and in sites/default/settings/php

(in the develop branch i want to make all my changes to code, themes and add contributed modules).

Currently i am in develop branch. When i try from Dev desktop: Push code to Cloud Dev I get this message:

NOTE: Your locally deployed branch 'develop' doesn't match 'master' deployed in the Cloud environment 'dev'. You will have to deploy 'develop' in the Cloud to see your code changes.

I know I get this message because I am currently in develop branch. But what do I have to do exactly before Push code to Cloud Dev to avoid this error message? What is the recommended procedure exactly to make changes to my code locally (on another branch) and Push code to Cloud Dev? And is it advisable to make those changes to code on another branch e.g. develop?

Update:

  1. I select develop in Acquia Cloud dev environment after git push origin develop. Till when? When do i have to choose master again?
  2. In my local repo i have added branch develop to add all my contributed modules and to develop the frontend etc. When do i have to merge it to master exactly? Or do i have to stay on develop all the time?

1 Answer 1

1

This simply means you need your develop branch to be pushed to the remote Acquia Cloud repository.

$ git push origin develop

Once you do so, just select develop in your Acquia Cloud dev environment. You'll now by in synch between your local and remote branch and will be able to push code as you expect.

UPDATE:

  1. Using the develop branch can be permanent or not, it's up to you. You can, say, have develop always checked out in dev, master in stage, and a git tag in prod. develop would then be your cutting-edge branch while master would be safer and primarily for QA. Sometimes, you'd have to delete develop and create it again from master to clean things up. It's part of a normal workflow.
  2. Don't be mistaken between a feature branch and a regular branch. develop isn't a feature branch, it's an integration branch. This means that you could have a feature branch locally called, say, twig-fixes that you would merge with develop when you're happy with the changes. You would then test your feature one last time in the develop branch locally and/or on Acquia Cloud, and then would take it from there.

NOTE: always create feature branches from master as it's your stable branch.

Example workflow:

$ git checkout master
$ git pull
$ git checkout -b twig-fixes

Do your work and commit changes to the feature branch, and, when you're ready to test your changes on the Acquia dev environment, merge your branch into the develop branch and push it to origin:

$ git checkout develop
$ git pull origin develop
$ git merge twig-fixes
$ git push origin develop

If all looks good, merge the feature branch into master using the squash option, to compact all commits into one commit only.

$ git checkout master
$ git merge --squash twig-fixes
$ git commit -m "Squashing twig-fixes"
$ git push origin master

If all looks good again in master, then you're free to delete your feature branch.

7
  • thanks a lot. I update my question to have things clear.
    – meez
    Mar 5, 2016 at 5:59
  • Updated answer.
    – anavarre
    Mar 5, 2016 at 8:30
  • I placed a new question regarding adding contributed modules.
    – meez
    Mar 8, 2016 at 7:47
  • currently i am adding contributed modules etc on my integration branch develop. I pushed my code to Acquia Cloud using git push origin develop. 1) When my client commits his code to Acquia Cloud Dev repo. What do I have to do exactly, so I make sure i have all the new code, regarding to branching/merging? 2) And also if my client wants to clone the Acquia Cloud Dev repo how do I make sure he has all latest code. Which branch he has to clone, or do I have to merge before?
    – meez
    Mar 8, 2016 at 19:25
  • sorry, do you have an answer on above, last comment? Thanks a lot.
    – meez
    Mar 10, 2016 at 10:43

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.