2015-09-03 3 views
44

を無視していない.gitignore私は私の.idea/パスを無視するgitを得るために行われる必要があること何をしないのですか?は.ideaパス

[email protected]:~/dev/1$ git status 
On branch master 
Your branch is up-to-date with 'origin/master'. 

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/.name 
    modified: .idea/misc.xml 
    modified: .idea/modules.xml 
    modified: .idea/vcs.xml 
    modified: .idea/workspace.xml 
    modified: src/Receiver.java 
    modified: test/1/agent/WindowsQueryHandlerTest.java 

Untracked files: 
    (use "git add <file>..." to include in what will be committed) 

    lib/ 
    mp1.iml 

no changes added to commit (use "git add" and/or "git commit -a") 

[email protected]:~/dev/1$ cat .gitignore 
*.class 

# Package Files # 
*.war 
*.ear 

# IDEA config files 
.idea/ 
+1

可能複製(http://stackoverflow.com/questions/1139762/ignore-:次に

は、提案w0lfコマンドでパスを含めます – Jubobs

答えて

108

.gitignoreのみ、新たに追加された(人跡未踏)のファイルは無視します。

すでにリポジトリに追加されたファイルを持っている場合は、すべての変更は、それらが.gitignoreルールにマッチした場合であっても、いつものように追跡されます。 (ディスクからそれを削除せずに)リポジトリからそのフォルダを削除するには

、ん:

git rm --cached -r .idea 
+3

fatal:pathspec '.idea'はどのファイルとも一致しません –

+0

上記のfata:pathspec ...エラーメッセージ – Solx85

+0

@ iLoveUnicorns gitにコミット/ステージングされた.ideaフォルダがありますか? – GolfWolf

11

がファイル

このミッションを完了するために、端末にコマンドを実行:)

を.gitignoreする .idea/を追加
git rm -rf .idea 
git commit -m "delete .idea" 
git push 
+1

fatal:pathspec '.idea'がファイルと一致しません – santafebound

+0

最初にプロジェクトディレクトリに移動してコマンドを実行してください – do01

3

fatal: pathspec '.idea' did not match any filesにはw0lfさんの回答があります:

あなただけ.ideaフォルダへの完全なパスを含める必要があります。

最初にgit statusを実行してください。現在の場所には.ideaのパスが表示されます。 git rm --cached -r example/path/to/.idea

[すでにGitのリポジトリにコミットされたファイルを無視]の