Remove directory from remote repository after adding them to .gitignore

Remove directory from remote repository after adding them to .gitignore

If we add the files to be ignored to .gitignore file, it will ignore the files with the future check ins.

This post describes how to remove the directory/files that is already in the remote respository .

1. Open up the git bash navigate to the project folder 

2. Do a git pull to make sure that local and remote repositories are synced.

2. Type in the following command to remove the folder name "target"

git rm -r --cached target








3. Commit the changes

git commit -m "Remove the now ignored target directory"







4. Do a git push

git push























Hope this helps :)










No comments:

 Python Basics How to check the version of Python interpreter mac terminal

Popular in last 30 days