Remove sub directory from Git sparse checkout

In howto on Aug 28, 2014 by theoryl Tagged: , ,

If you have configured Git to use sparse checkout to checkout a sub directory, but later decided that you don’t really need that sub directory, here’s what to do:

1. first delete the sub directory
2. open .git/info/sparse-checkout , delete the sub directory name in the list
3. git read-tree -mu HEAD

If you don’t do this, Git will stage the deletion of the sub directory for the next commit.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: