0

I have a doubt about the functionality of Drush Features commands when it works with git:

Before I do a git pull, can I do drush fu example? Will this command overwrite the changes of the feature coming with the pull and drush fr example will not work properly?

Thank you.

3 Answers 3

1

Your question is equivalent to asking if you can edit a file before doing a git pull. The answer is yes, but if there are conflicts, then you will need to merge them.

Returning to your example, if there are no changes to your local configuration, then the files that drush fu will write will be the same as the files currently in the repository. In this instance, git will happily do the pull, as it will consider the files to be unchanged, even if drush fu rewrote them.

If you do have changes (git status after drush fu will show this), then it would be a good idea to run git stash prior to git pull. After you pull, git stash pop will overlay your stashed changes on top of the pull, and you can see what the conflicts are.

Disclaimer: I have never hand-merged conflicts from features. I always pull the database from live to dev, and push code from dev to live to avoid this.

0

We have developed Kraftwagen which is specifically aimed at making Drupal projects more 'version control friendly'. The main win is that you only commit code that you wrote; the codebase of Druapl and modules are kept out of the repo.

Please have a look and let us know what you think of it!

0

I am giving a brief about Drush Feature Commands :

  1. drush fu feature_machine_name -y (Database to code entry) When you changes in your feature its state changed to Overriden. So you have to update the feature so that data from database write into the code.

  2. drush fr feature_machine_name -y (Code to database entry) When multiple people work on the project, there are more chances of conflicts. So before start working on anything, what you have to do is to pull the code befroe start working and revert the features which are on the Overriden state so that database entry done on the basis of new code come from you repo.

Your Answer

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

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