Delete the folder from Git

I have a local folder under git when I was playing with some git elements in different IDES, etc. it was added to git, but I don’t want it to be under git control, I just want it to be a regular folder! until I decide to add it to some repo later.

I am new to git, so I don't know many commands, but if I run the command git status, 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/
+5
source share
5 answers

It looks like you want to delete the git repository that was automatically created by the IDE. (Note that it gitdoes not track folders, only files.)

If so, just delete the directory .gitand you will be left with a folder that is not tracked by git at all.

+10

git rm --cached, ( ), .gitignore. .gitignore .

+2

, git, :

git status | grep [d]eleted | awk '{print $3}' | xargs git rm --cache
+1

, git ; . , - git, git rm <filename>. git status, . , git rm --cached <filename> , . , .gitignore , . git .

+1

Create a file called .gitignore and add the path to the folder you want to ignore (in the end, use "/").

Complete doc: https://help.github.com/articles/ignoring-files

0
source

All Articles