Last active
July 31, 2020 12:20
-
-
Save francoisgeorgy/ac861ac1eb768de097f30e5417c6f672 to your computer and use it in GitHub Desktop.
#git remove a folder from git
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 1. Add the folder path to the repo's root .gitignore file: | |
| dist/ | |
| # 2. Remove the folder from the local git tracking, but keep it on your disk: | |
| git rm -r --cached dist/ | |
| # 3. Push the changes to the git repo | |
| # The folder will be considered "deleted" from Git's point of view (i.e. they are in past history, but not in the latest commit, and people pulling from this repo will get the files removed from their trees), but stay on your working directory because you've used |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment