checkout only one file using git

First clone the repo with the following command below,
git clone -n git://path/to/the_repo.git --depth 1

The -n option suppresses the default checkout of all files, and the --depth 1 option, which means it only gets the most recent revision of each file
Then check out just the file you want like so:
Then you can checkout the file that you wanted to get or save to your machine.

$> cd the_repo
$> git checkout HEAD name_of_file

Comments

Popular posts from this blog

LVM: How to remove a volume using pvremove

Using Oracle 11g thru VirtualBox appliance in Mac OS X Lion

Use Shell Editor for Eclipse for editing bash, ksh, csh in Unix/Linux system