Yan Pritzker photographer, entrepreneur, software engineer, musician, skier

Blog :: Git Workflows Book :: Dotfiles :: Photography :: About Me

TwitterCounter for @skwp

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

hello, i'm yan

I am a photographer, entrepreneur, software engineer, guitarist, climber, and telemark skier

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

Enterprise intelligence with prediction markets

Find out what your team, colleagues and partners really know about the future — and leverage their knowledge to improve business decisions.

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

Archives

Contact

Reach me at yan at pritzker.ws

Git rm pending files

Posted 10 June 2008 @ 6am | Tagged git, thoughts, tips


Submit to HN

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