Wilbur's blog

Committing file deletions with GIT

When you are working with a GIT repo, and you need to delete files, the best way to do that is to use a GIT command directly.  You can delete individual files:

git rm that/filename.txt

And you can delete whole folders too:

git rm -rf this/here/folder

But what to do when an automated process deletes file for you?  Now GIT reports a long list of deleted files, but there is no way to add that that change - actually REMOVE that change in an automated way.  Or is there?

Pushing to a READ-ONLY GIT Repo - yes you can!

We're using BitBucket to host some private repos for clients lately.  This is a great approach for small teams, you can get private repos for FREE, but your team size is limited to 6 team members I think.  

The Setup

So setting up remotes on your website server is easy, you add the SSH remote to be able to do pull requests from the repo:

git remote add git@bitbucket.org:your-account/your-repo-name.git

All fine and good, but what *IF* you want to actually PUSH some changes from this branch?  Trying the following push request:

Drupal Object Log

Drupal Modules: 

Over the past few months I have been writing array object to watchdog as messages.  This is pretty handly for seeing LOTS of variable arrays in some sort of order.  Here's a snippet from Dropbucket where I got the idea:

watchdog("my_module", '<pre>' . print_r( $my_array_or_object, true) . '</pre>');

This approach might be OK on your local dev environment, but you do NOT want to do this on your live site!  All those messages become translatable strings, and get piled up in the translation table.  That becomes a big mess quick.  

Pages

Subscribe to RSS - Wilbur's blog