Skip to content

Instantly share code, notes, and snippets.

@kae76
Last active January 4, 2016 17:39
Show Gist options
  • Save kae76/8655430 to your computer and use it in GitHub Desktop.
Save kae76/8655430 to your computer and use it in GitHub Desktop.
Drupal Features

Fork off source repo:

your-organzation/repo-name, preparing the git side of things.

// delete current remote origin (git@).
git remote rm origin
// Add fork as origin user/organzations/repo-name (with push perms).
git remote add origin [email protected]:user/repo-name.git
// Add source repo as upstream (https).
git remote add upstream https://github.com/organzations/repo-name.git
// Check out branch and create a local version
git checkout -b branch-name

Create the Feature:

its all magic!

Testing the Feature:

// Back up db via sql dump.
drush sql-dump --gzip --results-file=../drupal7_server_db-name-2014-xx-xx-local.sql.gz
// Import previous db dump (this has to be a db which does not have your new feature on).
drush sql-cli < ../db/drupal7_server_db-name-2014-xx-xx.sql.gz
// Rebuild registry, clear cache, enable newly created feature. drush rr
drush cc all
drush enable ht_admin_area

if all works!

Getting your work ready for a pull request:

git status
// Check out branch and create a local version
git checkout -b branch-name
git add sites/all/modules/features/branch-name
git commit -m "Adding 'feature name' feature, something sensible like the ticket/issue number, and brief description"
git push origin features/branch-name
// Go to you commit on Github, to find out what the commit id...
git log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment