User login

Git

Using Git submodules to share modified Drupal modules across sites

This reference is currently somewhat specific to Agaric's setup. We currently use Drush to update modules rapidly on a per-site basis (rather than updating a module in a central location and pushing it to the sites that use it), but certain modules have special needs (extra files, a patch that needs to be applied and hasn't been committed to Drupal.org version control yet) and when these modules have to be used on multiple sites, we can save time by bringing them in as submodules. Here are the notes from the first time we did this.

Sharing a complex Drupal patch for contributing to core, with git

cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout drupal
cd drupal/
git init
git add *
git status
git add .htaccess
git commit -m 'first commit of unmodified current Drupal 7 head'
git remote add origin git@github.com:benjamin-agaric/drupal-taxonomy-as-fields.git
git push origin
patch -p0 < terms_as_fields.patch
git status
git commit -a -m "bangpound's proof of concept working fundamentals of getting CCK fields for terms and deprecating taxonomy_nodeapi"
git push

Setup an Ubuntu Development Environment the Agaric Way

Update: See Installing Drubuntu

Use the following commands to set up a development environment on Ubuntu (8.10).

Manually add a new repository to the Agaric test server

If done manually, basic code is this:

On the test server:

cd /srv/git/
mkdir projectname.git
cd projectname.git
git init --bare

Back in your project on your local computer:

git remote add origin git.example.com:/srv/git/projectname.git
git push origin master

Updating a module in Git (the hard way, resolving a conflict)

(Some old notes from Stefan that I had to look up, so putting them online).

yesterday night i learnt some git. now i can tell you the meaning of fast-forward.
when you create a new branch off another one and after some time you want to merge the changes and the other branch hasn't advanced it's a fast forward merge. otherwise a merge commit will be crated.
if you want to merge changes to the original branch you forked off you should firts pull any changes from that one before merging or tou risk losing commits.

Git push failed.

Cryptic Git Error Means There's No Git There

dan@mini9:~$ sudo git clone http://git.agaricdesign.com/git/drupal-6-agaric-core.git leftysbrew
Initialized empty Git repository in /home/dan/leftysbrew/.git/
Cannot get remote repository information.
Perhaps git-update-server-info needs to be run there?
dan@mini9:~$ sudo git-update-server-info
fatal: Not a git repository

Adding third-party code to Agaric's core site repository: Print module's PDF functionality

At Administer › Site configuration › Printer-friendly pages, the PDF tab will tell you:

No PDF generation tool found! Please dowload a supported PHP PDF generation tool. Check this module's INSTALL.txt for more details.

Git non fast forward failed to push some refs WHAT?

sudo git push
To /srv/git/drupal-6-agaric-core.git
! [rejected] master -> master (non-fast forward)
error: failed to push some refs to '/srv/git/drupal-6-agaric-core.git'

Uh... right.

But do not fear! This error likely just means other changes have been made that you should pull in first.

Watch:

Git on Windows

Easiest maybe best way is to create a new public-private key pair in Git, as mentioned in Getting Started with Git and GitHub on Windows:

ssh-keygen -C "username@email.com" -t rsa

Another fix for public key denied errors, mentioned on the GitHub discussion group, was

tuning my .ssh/config file to include these lines:

Drupal core in Git

For Drupal core development in Git rather than CVS, git://github.com/mikl/drupal.git is updated every hour from Drupal.org's CVS.

Resolution

Syndicate content