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
@rahul-bali

This comment has been minimized.

Copy link

rahul-bali 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

@pb25193

This comment has been minimized.

Copy link

pb25193 commented May 23, 2019

didnt work for me, i got: pathspec 'node_modules' did not match any files

note: my node modules is inside a subfolder. can anyone help?

@DataIsMeta

This comment has been minimized.

Copy link

DataIsMeta commented Jul 5, 2019

Thanks!

@tgarijo

This comment has been minimized.

Copy link

tgarijo commented Jul 15, 2019

Thank You!!

@kor1k

This comment has been minimized.

Copy link

kor1k commented Aug 21, 2019

Thank you, it works fine!

@juampi92

This comment has been minimized.

Copy link

juampi92 commented Aug 21, 2019

Thanks a lot man!

@sabarasaba

This comment has been minimized.

Copy link
Owner Author

sabarasaba commented Aug 21, 2019

@juampi92 You look hot with that dog, can I take you on a date?

@juampi92

This comment has been minimized.

Copy link

juampi92 commented Aug 21, 2019

@sabarasaba with me or with the dog?

@sabarasaba

This comment has been minimized.

Copy link
Owner Author

sabarasaba commented Aug 21, 2019

@juampi92 yes

@clockshark

This comment has been minimized.

Copy link

clockshark commented Sep 27, 2019

worked for me..thanks

@DataIsMeta

This comment has been minimized.

Copy link

DataIsMeta commented Oct 1, 2019

@juampi92 yes

Please let us know how the date went.

@bilalelhoudaigui

This comment has been minimized.

Copy link

bilalelhoudaigui commented Nov 12, 2019

Thanks!

@personalaccount

This comment has been minimized.

Copy link

personalaccount commented Nov 18, 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.