1

My .gitignore contains the following line

build/

And, the directory structure of my project looks like

/myproject
   .gitignore
   /sub_prj1
      /build
   /sub_prj2
      /build
   ...

However after git push, the build directory under all sub_prj1, sub_prj2... exists in the remote.

How can I ignore build directory ?

Robin Green
  • 32,079
  • 16
  • 104
  • 187
J. Kotaki
  • 11
  • 2

1 Answers1

0

From what you said

However after git push, the build directory under all sub_prj1, sub_prj2... exists in the remote

I will suggest on your local, run

git rm -- <path> 

git status //to confirm you have no any other issue 

after which you then

git add .
git commit -m "whatever message you choose"
git push

This should solve your issue.

antzshrek
  • 9,276
  • 5
  • 26
  • 43