User login

Cloning git locally to test a Drupal module in development on multiple sites

Working on a site (DefinitiveDrupal.org) which is in its own big Git repository. But when working on a module that's custom to the site but probably will become generalized and contributed back, we simply git init in that module's directory to make it a repository too. No git submodules or other voodoo. In addition to getting us an independent commit history for that module, it gives us the ability to throw that module into other situations and work on it there.

Here we make a working copy of our module and repository from the Definitive Guide to Drupal 7 project (dgd7) in the Drupal 7 head checkout in which we're also testing patches involving input formats (if).

/workspace/if/sites/all/modules/dgd7_tip$ git clone ~/code/dgd7/drupal/sites/all/modules/custom/dgd7_tip/.git/ dgd7_tip

And now changes we make and commit in dgd7/drupal/sites/all/modules/custom/dgd7_tip can be pulled over in if/sites/all/modules/dgd7_tip.

Reference

http://www.kernel.org/pub/software/scm/git/docs/git-clone.html
http://www.kernel.org/pub/software/scm/git/docs/git-pull.html

Searched words: 
git pull from a local repository

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.