« This is what I look like | Main | 2010 Road Bike Route: 26 Miles in North Boston Suburbs »

April 12, 2010

CVS equivalents in git

These days I'm 100% using git for version control. My past two employers were strongly tied to CVS for version control, meaning that means since 2001 I've been using mostly CVS (occasional SVN for side projects).

There are a few things I got into the habit with CVS, and want to see when using git. Here's a growing list of things I'm discovering in git to help with my coding workflow.

Show files that haven't been added to version control

I used to get this information with the CVS update command, where it would say "I know nothing about..."

With git:

git ls-files -o .

And to only show files *after* the ignore rules have applied:


git ls-files --exclude-standard -o .

I've created an alias for this command so it's easy to quickly see without having to remember the option syntax:


alias git-new-files='git ls-files --exclude-standard -o .'

Show names of files that have been updated but not committed

Information that was available from CVS update where it would mark it with "M" to note that the file was modified.

With git:

git diff --name-only .

I suppose there are shortcuts for these, my git skills will grow stronger.

Posted by mike at April 12, 2010 12:39 PM