I have a local folder that is under git, when I was playing with some git stuff in different IDES, etc it got added to the git but I don't want it to be under git control, I just want it to be a normal folder for now! until I decide to add it to some repo later.
I am new to git so don't know much commands but if I run a git status
command this is what I get:
git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
# (use "git rm --cached <file>..." to unstage)
#
# new file: .idea/vcs.xml
# new file: .idea/workspace.xml
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: .idea/workspace.xml
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .idea/.name
# .idea/.rakeTasks
# .idea/HisFirstService.iml
# .idea/dictionaries/
# .idea/encodings.xml
# .idea/misc.xml
# .idea/modules.xml
# .idea/scopes/
# Gemfile
# Gemfile.lock
# README
# Rakefile
# client.rb
# config/
# db/
# models/
# service.rb
# spec/
You can delete an individual file or an entire directory in your repository on GitHub. People with write permissions can delete files or directories in a repository.
Using the git rm –cached Command We've mentioned that git rm FILE will remove files from the index and local working tree by default. However, the git rm command provides the –cached option to allow us only to remove files from the repository's index and keep the local file untouched. As we can see, the user-list.
Use git rm --cached
to remove this directory from repository (it should stay in your working directory) and then put it's name into .gitignore file. At the end commit both .gitignore and directory removal.
It sounds like you want to remove a git repository that was automatically created by an IDE. (Note that git
doesn't track folders, only files.)
If that's the case, just remove the .git
directory and you'll be left with a folder that isn't tracked by git at all.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With