tags:

views:

38

answers:

1

I have an Xcode project that uses git for version control. I have a .gitignore file to ignore the build subdirectory:

build/*

I recently added a subdirectory that contains an Xcode project and forgot to update the .gitignore file before checking it in.

Is there any way to make git ignore the build subdirctory now, after the fact?

Thanks, Doug

+3  A: 
 git rm --cached dirToignore
 echo dirToignore >>.gitignore

From there, a new commit will record that:

  • dirToignore is no longer par of versioned data
  • dirToIgnore won't show up anymore in git status

See this SO question for similar advices.
If you want to amend previous commit in order to remove said subdirectory from an old commit, see this SO question:

 git commit --amend

can help you remove it from at least the last commit.

VonC
Very cool. Thanks VonC.
dugla