2

In my .gitignore file I added a path to folder I don't want to see in GitHub website:

Results/.ipynb_checkpoints/

Then I push this changes:

git commit -a -m "add ignore"
git push origin master

But when I go to site, I still see this folder. How to do it correctly?

Vy Do
  • 46,709
  • 59
  • 215
  • 313
Kenenbek Arzymatov
  • 8,439
  • 19
  • 58
  • 109
  • If you already commited the folder and uploaded it, you have to remove it. Possible duplicate: http://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore – darthbith Oct 08 '16 at 14:35

2 Answers2

4

You need to remove the folder now that it is in the .gitignore. You can do this by deleting the folder locally, adding changes, commit it and then push it. If you need the folder in your local repository you can then recover it by making a backup, before deleting it.

If you however do not want to remove the folder locally, and delete it just from the remote, you can do:

git rm -r --cached Results/.ipynb_checkpoints/
git commit -m "Removed folder from repository"
git push origin master

More about deleting a file/folder from the remote repository but not locally can be read in this question and answers.

Community
  • 1
  • 1
Basilio German
  • 1,801
  • 1
  • 13
  • 22
1

Delete directory .ipynb_checkpoints at local repository.

git rm -rf '.ipynb_checkpoints'

Then do

git rm --cached '.ipynb_checkpoints'

add changing(include delete event),

git add -A .

Make commit

git commit -m "Clean working directory"

Push the changing to server (remote repository)

git push
Vy Do
  • 46,709
  • 59
  • 215
  • 313