skwpspace yan pritzker’s home on the web

skwpspace is Yan Pritzker's home on the web

Blog :: Photography :: About Me

TwitterCounter for @skwp

Get the news feed
Get updates by email
Follow me on twitter

hello, i'm yan

This blog is about startups, blogging, Ruby On Rails, virtualization and cloud computing, photography, customer service, marketing, ux and design, git, and lots more.

Top Posts

planypus

I'm the founder of Planypus, the place to share your plans!

cohesiveft

Accessible, manageable, virtualized application stacks ready to download or deploy to the cloud!

flickr

it's hailing in san franciscojessatianalyndaBird in the handkerimodeldanielle pettee and models-4449

Archives

Contact

Reach me at yan at pritzker.ws

Posted
10 June 2008 @ 6am

Tagged
git, thoughts, tips

Git rm pending files

If you’ve deleted a bunch of files in your directory, here’s a handy bash alias to git rm the changes into your index.



alias gitrm="git stat | grep deleted | awk '{print $3}' | xargs git rm"

Update: turns out git add -u takes care of deleted files.


2 Comments

Posted by
Wes Sheldahl
29 July 2008 @ 10am

That looks handy. Nice tip!

Since awk also does what grep does, you can make that a little shorter:

alias gitrm=”git stat | awk ‘/deleted/ {print $3}’ | xargs git rm”


Posted by
Yan
29 July 2008 @ 5pm

Thanks! As it turns out all of this is totally unnecessary as git already takes care of it. Pardon my ignorance! Here’s the git command to take care of staging deleted files as well as changed files:

git add -u


Leave a Comment

Testing your ActiveRecord migrations Long running Threads in Rails and metaprogramming fun