Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Remove directory from remote repository after adding them to .gitignore
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@thebali

This comment has been minimized.

Copy link

thebali commented Jun 6, 2018

works. thank you.

@karthikrp

This comment has been minimized.

Copy link

karthikrp commented Jun 12, 2018

Wow., Simple and effective. Thank you..!!

@Rohitkrops

This comment has been minimized.

Copy link

Rohitkrops commented Jul 14, 2018

Great solution, worked like a magic

@ssougnez

This comment has been minimized.

Copy link

ssougnez commented Jul 23, 2018

Thanks

@knutvalen

This comment has been minimized.

Copy link

knutvalen commented Jul 25, 2018

Thank you!

@Navidnkh

This comment has been minimized.

Copy link

Navidnkh commented Jul 29, 2018

Thanks

@rahuls321

This comment has been minimized.

Copy link

rahuls321 commented Aug 4, 2018

Thanks @sabarasaba

@paulbirchamBBK

This comment has been minimized.

Copy link

paulbirchamBBK commented Aug 14, 2018

Thanks!

@snakydragon

This comment has been minimized.

Copy link

snakydragon commented Aug 15, 2018

Thanks! It works magically!

@benhoverter

This comment has been minimized.

Copy link

benhoverter commented Aug 23, 2018

Thanks from another git noob!

@quintanilhaedu

This comment has been minimized.

Copy link

quintanilhaedu commented Aug 30, 2018

Thanks man! You've saved my time! <3

@Michelasso

This comment has been minimized.

Copy link

Michelasso commented Sep 6, 2018

It worked just fine! Thanks a lot!

@moravveji

This comment has been minimized.

Copy link

moravveji commented Sep 11, 2018

Just asking to make sure:
After following the excellent suggestion above to remove a directory , should I still keep the "MyDir" entry in my .gitignore file?
I would like to protect it against an unwanted upload during the next push.

@tirudevi

This comment has been minimized.

Copy link

tirudevi commented Oct 5, 2018

How to remove project folder from current repository

@maddy-nit

This comment has been minimized.

Copy link

maddy-nit commented Oct 25, 2018

Thanks. It worked.

@krolovolk

This comment has been minimized.

Copy link

krolovolk commented Oct 25, 2018

Thanks! Simply and efficiently

@Phionanamugga

This comment has been minimized.

Copy link

Phionanamugga commented Nov 27, 2018

Thank you

@savicas

This comment has been minimized.

Copy link

savicas commented Dec 5, 2018

Fantastic. Thank you!

@arcandio

This comment has been minimized.

Copy link

arcandio commented Dec 6, 2018

Worked perfectly, thanks!

@afshintalebi

This comment has been minimized.

Copy link

afshintalebi commented Jan 5, 2019

Great, Thanks.

@guljarpd

This comment has been minimized.

Copy link

guljarpd commented Feb 9, 2019

Thanks, Create Work!

@trangthanhtam

This comment has been minimized.

Copy link

trangthanhtam commented Feb 20, 2019

Hi, simple and perfect 👍

@scarneros

This comment has been minimized.

Copy link

scarneros commented Feb 20, 2019

Thanks! Works really well!

@t4tiwari19

This comment has been minimized.

Copy link

t4tiwari19 commented Feb 21, 2019

Worked like a charm , Thanks for sweet and simple solution

@Tahirhan

This comment has been minimized.

Copy link

Tahirhan commented Mar 19, 2019

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.