2016-09-09 2 views
0

私はリモートでクローンしたローカルディレクトリを持っています。しかし、追加、コミット、リモートサーバーへのプッシュを試みると、次のようになります。シンボリックリンクしたフォルダを追加、コミット、プッシュしようとするとエラーが表示されます

ご了承ください。その後

$ git add . 
warning: LF will be replaced by CRLF in .meteor/.finished-upgraders. 
The file will have its original line endings in your working directory. 
warning: LF will be replaced by CRLF in .meteor/.gitignore. 
The file will have its original line endings in your working directory. 
warning: LF will be replaced by CRLF in .meteor/.id. 
The file will have its original line endings in your working directory. 
warning: LF will be replaced by CRLF in .meteor/packages. 
The file will have its original line endings in your working directory. 
warning: LF will be replaced by CRLF in .meteor/platforms. 
The file will have its original line endings in your working directory. 
warning: LF will be replaced by CRLF in .meteor/release. 
The file will have its original line endings in your working directory. 
warning: LF will be replaced by CRLF in .meteor/versions. 
The file will have its original line endings in your working directory. 
error: readlink("node_modules"): Function not implemented 
error: unable to index file node_modules 
fatal: adding files failed 

:次に

$ git commit -a -m "commit" 

On branch master 

Initial commit 

Untracked files: 
     .gitignore 
     .meteor/ 
     node_modules 
     server/ 
     tsconfig.json 
     tslint.json 
     typings 

nothing added to commit but untracked files present 

$ git push 
error: src refspec master does not match any. 
error: failed to push some refs to 'https://git.heroku.com/remote-thewhozoo.git' 

た場合もI:

$ git remote show origin 
* remote origin 
    Fetch URL: https://git.heroku.com/remote-thewhozoo.git 
    Push URL: https://git.heroku.com/remote-thewhozoo.git 
    HEAD branch: (unknown) 
    Local branch configured for 'git pull': 
    master merges with remote master 

あなたが見ることができるように、私はシンボリックリンクを持っています。

enter image description here

+0

'.gitignore'ファイルには何がありますか? – Shravan40

+0

'.gitignore'は' node_modules/'を持っています – Richard

+0

最近' .gitignore'ファイルに 'node_modules /'を追加しましたか? – Shravan40

答えて

1

ファイルを追加しようとすると、あなたの問題が既に発生します。

error: readlink("node_modules"): Function not implemented 
error: unable to index file node_modules 
fatal: adding files failed 

一つの解決策ではなく、一度にすべてを追加し、node_modulesをスキップする明示的人跡未踏ファイルを追加することです。これにより、変更をコミットしてプッシュすることができます。しかし、私はこれが長期的にあなたの問題を解決しないと思う。

エラーメッセージは、node_modulesがシンボリックリンク(シンボリックリンク)であることを示しています。したがって、2つの選択肢があります:そのフォルダをバージョンアップする必要がない場合は、/node_modulesを追加して.gitignoreに追加することができます。あなたはそれを追跡する必要がある場合は、truecore.symlinkを設定することによってこれを行うことができます。いずれの場合も

git config core.symlinks true 

あなたはすべてのエラーを得ることなくgit add .を実行することができます。

+0

あなたは正しいです、私はシンボリックリンクを持っています。私はあなたがそれを知っていることに驚いています。私は主な質問にそれを加えました。 'git config core.symlinks true'を試してみましょう。ありがとう! – Richard

+0

ありがとう、あなたは私の問題を解決しました。 – Richard

+1

node_modulesをgitに追加するという恐ろしい習慣があるようです。あなたはそれをシンボリックリンクするので恐ろしい倍です。 –

関連する問題