Git

Find newly added files with Git

OK, this is a stupid one-liner, but it works.

Here's how to find newly added files to a Git repository :

git whatchanged | grep : | grep ' A' | grep -v Author: | grep -v Date: | grep \.\.\. | more

:000000 100644 0000000... 89fd0d4... A tests/f1.php
:000000 100755 0000000... c430e79... A tests/f2.php
:000000 100755 0000000... 130edda... A tests/f3.php
:000000 100644 0000000... 0f395e9... A tests/f4.php
.
.
.

See this quick reference :

Categories: 

Maintaining Drupal with fake Git submodules

With Drupal moving to the Git version control system, I'm looking at refining a good way to install, update, and customize Drupal installations using Git.

Since Drupal core, modules, and themes will be separate Git repositories, it seems like using Git submodules, or subtrees are worth looking into for module and theme management.

Categories: 

Upgrading Drupal 6 to Drupal 7 Using Git

The Drupal UPGRADE.txt file and upgrade handbook page provide a lot of good information and procedures to perform a major upgrade (ex. 6.x => 7.x).

However, if you're looking to manage your Drupal 7 installation using Git, the upgrade guides don't provide Git-specific advice.

Here's a procedure I found useful when upgrading Drupal 6 to Drupal 7 using Git.

First, clone the Drupal 7 git repository using this :


git clone git://github.com/drupal/drupal.git

Scmbug for Git/BitKeeper - Bugzilla Integration

I ran across an interesting open source program called Scmbug. Scmbug is a system that integrates software configuration management with bug-tracking.

I was looking for a tool that would help with :

* Showing what bugs are fixed in a particular build or revision control commit?

* Automatically updating a bug tracker when bugs are completed (fixed) and approved.

* Not allowing unapproved bugs to be committed to a given branch.

Categories: 

Getting "git rm" to work

I thought I could remove files from Git pretty easily with essentially :


  $ git rm myfile.php
  $ git commit -m "Removing a file"

But I was getting this error upon commit : "Could not open input file myfile.php"

This is how I got it to work. The Git Cheat Sheet (http://cheat.errtheblog.com/s/git) described this as "Commit the absence of myfile.txt to the project"


  $ git rm --cached myfile.php
  $ git commit -m "Removing a file"
Categories: 

Cheap PHP lint checking with Git

Running PHP's "built-in" lint checker (php -l) is a quick way to remove syntax errors which should never creep into your code.

However, you'll no doubt soon tire of typing "php -l" before every Git commit message, so why not let Git do the checking for you with a "pre-commit hook".

Travis Swicegood has a great article on how to set this up with Git :
http://phpadvent.org/2008/dont-commit-that-error-by-travis-swicegood

I found you could pretty much copy his pre-commit PHP script and paste it into your .git/hooks directory with a couple caveats :

    Categories: 

    Installing Hudson, Phing, PHPUnit and Git on Ubuntu

    In this post, I'm just trying to get the simplest setup. I'll try to post details in a subsequent post.

    Here are three posts, in descending order, on this that I found useful :

    http://toptopic.wordpress.com/2009/02/26/php-and-hudson/

    http://blog.jepamedia.org/2009/10/28/continuous-integration-for-php-with...

    http://www.davegardner.me.uk/blog/2009/11/09/continuous-integration-for-...

    First, I had to install java :

        $ sudo aptitude install sun-java6-jre  

    Pages

    Subscribe to RSS - Git