0

Git に配置したいプロジェクトがあります。Git で問題が発生したことはありませんが、何らかの理由でこのプロジェクトでは機能しません。私のプロジェクトはすべて共有ネットワーク ドライブにあります。まず、ネットワーク ドライブに新しいリポジトリを作成し、次にこのリポジトリを自分のシステムに複製しました。次に、既存のプロジェクトを Git/projectname フォルダーにコピーします。コミットを行い、追加されたすべてのファイルを選択しようとすると、下のスクリーンショットに示すようにエラー メッセージが表示されます。

ここに画像の説明を入力

コミットのみが正常に機能しますが、プッシュしようとすると別のエラー メッセージが表示されます。

ここに画像の説明を入力

すべてのファイルを選択した後のエラー メッセージ:

    warning: LF will be replaced by CRLF in Tool/Content/chosen.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/css/select2.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/jquery-ui.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/jquery.ui.accordion.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/jquery.ui.all.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/jquery.ui.autocomplete.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/jquery.ui.base.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/jquery.ui.button.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/jquery.ui.core.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/jquery.ui.datepicker.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/jquery.ui.dialog.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/jquery.ui.menu.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/jquery.ui.progressbar.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/jquery.ui.resizable.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/jquery.ui.selectable.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/jquery.ui.slider.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/jquery.ui.spinner.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/jquery.ui.tabs.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/jquery.ui.theme.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/jquery.ui.tooltip.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/minified/jquery-ui.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/minified/jquery.ui.accordion.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/minified/jquery.ui.autocomplete.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/minified/jquery.ui.button.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/minified/jquery.ui.core.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/minified/jquery.ui.datepicker.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/minified/jquery.ui.dialog.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/minified/jquery.ui.menu.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/minified/jquery.ui.progressbar.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/minified/jquery.ui.resizable.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/minified/jquery.ui.selectable.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/minified/jquery.ui.slider.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/minified/jquery.ui.spinner.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/minified/jquery.ui.tabs.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/minified/jquery.ui.theme.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Content/themes/base/minified/jquery.ui.tooltip.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Scripts/chosen.jquery.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Scripts/jquery-2.0.3.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Scripts/jquery-2.0.3.min.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Scripts/jquery-ui-1.10.3.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Scripts/jquery-ui-1.10.3.min.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Scripts/noty/jquery.noty.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Scripts/noty/layouts/bottom.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Scripts/noty/layouts/bottomCenter.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Scripts/noty/layouts/bottomLeft.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Scripts/noty/layouts/bottomRight.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Scripts/noty/layouts/center.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Scripts/noty/layouts/centerLeft.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Scripts/noty/layouts/centerRight.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Scripts/noty/layouts/inline.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Scripts/noty/layouts/top.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Scripts/noty/layouts/topCenter.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Scripts/noty/layouts/topLeft.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Scripts/noty/layouts/topRight.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Scripts/noty/promise.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Scripts/noty/themes/default.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Scripts/select2.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Tool/Scripts/select2.min.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/EPPlus.3.1.3.3/EPPlus.3.1.3.3.nuspec.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/Select2.js.3.4.1.2/content/Content/css/select2.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/Select2.js.3.4.1.2/content/Scripts/select2.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/Select2.js.3.4.1.2/content/Scripts/select2.min.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/chosen.0.12.0/content/Content/chosen.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/chosen.jquery.0.12.0/content/Scripts/chosen.jquery.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.2.0.3/Content/Scripts/jquery-2.0.3.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.2.0.3/Content/Scripts/jquery-2.0.3.min.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.2.0.3/jQuery.2.0.3.nuspec.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/jquery-ui.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/jquery.ui.accordion.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/jquery.ui.all.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/jquery.ui.autocomplete.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/jquery.ui.base.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/jquery.ui.button.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/jquery.ui.core.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/jquery.ui.datepicker.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/jquery.ui.dialog.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/jquery.ui.menu.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/jquery.ui.progressbar.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/jquery.ui.resizable.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/jquery.ui.selectable.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/jquery.ui.slider.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/jquery.ui.spinner.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/jquery.ui.tabs.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/jquery.ui.theme.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/jquery.ui.tooltip.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/minified/jquery-ui.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/minified/jquery.ui.accordion.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/minified/jquery.ui.autocomplete.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/minified/jquery.ui.button.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/minified/jquery.ui.core.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/minified/jquery.ui.datepicker.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/minified/jquery.ui.dialog.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/minified/jquery.ui.menu.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/minified/jquery.ui.progressbar.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/minified/jquery.ui.resizable.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/minified/jquery.ui.selectable.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/minified/jquery.ui.slider.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/minified/jquery.ui.spinner.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/minified/jquery.ui.tabs.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/minified/jquery.ui.theme.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Content/themes/base/minified/jquery.ui.tooltip.min.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Scripts/jquery-ui-1.10.3.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/Content/Scripts/jquery-ui-1.10.3.min.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jQuery.UI.Combined.1.10.3/jQuery.UI.Combined.1.10.3.nuspec.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jquery.noty.2.1.0/content/Scripts/noty/jquery.noty.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jquery.noty.2.1.0/content/Scripts/noty/layouts/bottom.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jquery.noty.2.1.0/content/Scripts/noty/layouts/bottomCenter.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jquery.noty.2.1.0/content/Scripts/noty/layouts/bottomLeft.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jquery.noty.2.1.0/content/Scripts/noty/layouts/bottomRight.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jquery.noty.2.1.0/content/Scripts/noty/layouts/center.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jquery.noty.2.1.0/content/Scripts/noty/layouts/centerLeft.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jquery.noty.2.1.0/content/Scripts/noty/layouts/centerRight.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jquery.noty.2.1.0/content/Scripts/noty/layouts/inline.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jquery.noty.2.1.0/content/Scripts/noty/layouts/top.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jquery.noty.2.1.0/content/Scripts/noty/layouts/topCenter.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jquery.noty.2.1.0/content/Scripts/noty/layouts/topLeft.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jquery.noty.2.1.0/content/Scripts/noty/layouts/topRight.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jquery.noty.2.1.0/content/Scripts/noty/promise.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jquery.noty.2.1.0/content/Scripts/noty/themes/default.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in packages/jquery.noty.2.1.0/jquery.noty.2.1.0.nuspec.
The file will have its original line endings in your working directory.
DoneStage 303 files

プッシュ後のエラー メッセージ:

"C:\Program Files (x86)\Git\bin\git.exe" push --recurse-submodules=check --progress "origin" master:master
Counting objects: 236, done.
Delta compression using up to 4 threads.
Total 236 (delta 55), reused 0 (delta 0)
remote: error: refusing to update checked out branch: refs/heads/master[K
remote: error: By default, updating the current branch in a non-bare repository[K
remote: error: is denied, because it will make the index and work tree inconsistent[K
remote: error: with what you pushed, and will require 'git reset --hard' to match[K
remote: error: the work tree to HEAD.[K
remote: error: [K
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to[K
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into[K
remote: error: its current branch; however, this is not recommended unless you[K
remote: error: arranged to update its work tree to match what you pushed in some[K
remote: error: other way.[K
remote: error: [K
remote: error: To squelch this message and still keep the default behaviour, set[K
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.[K
To G:/eTemplate_tools
 ! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'G:/eTemplate_tools'
Done

2回目のプッシュを試した後:

"C:\Program Files (x86)\Git\bin\git.exe" push --recurse-submodules=check --progress "origin" master:master
Counting objects: 236, done.
Delta compression using up to 4 threads.
Total 236 (delta 56), reused 0 (delta 0)
remote: error: unable to write sha1 filename ./objects/pack/pack-53d213811e38773414f34a05b02d1051e5609dc5.pack: Permission denied[K
remote: fatal: cannot store pack file[K
error: unpack failed: index-pack abnormal exit
To G:/eTemplate_tools
 ! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'G:/eTemplate_tools'
Done
4

1 に答える 1

2

では、どうぞ。git のセットアップには 3 つの明らかな問題があります。

3番目のものを指摘してくれた@Cupcakeに感謝します。

最も重要なものから最も重要でないものへ:

  • 裸でないリポジトリにプッシュしようとしています。これは推奨されておらず、実際には最近の git バージョンのエラーです。裸のレポにプッシュする必要があります。詳細については、https ://stackoverflow.com/a/18260792/2536029 を参照してください。

  • core.autocrlf以外に設定していfalseます。core.autocrlfこれにより、git は、環境、問題のファイル、および以前に適用された変換の正確な値に応じて、行末を自動的に変換しようとします。

    一部の貢献者は Windows を使用し、他の貢献者は UNIX を使用するシナリオでこれが役立つと主張する人もいますが、私の意見では、予期せずファイルを予測しにくく (特に初心者にとって) 追跡しにくい方法で変更するため、問題が発生することが多いと考えられます。メールやその他のチャンネルで話し合うとすぐに迷子になってしまうので、コミュニケーションを取りましょう。

    <rant>git は、私が python が一番好きだと言ったとしても、すべてのコードを python に変換するわけではありません。フランス語のロケールを使用していても、すべてのコメントがフランス語に翻訳されるわけではありません。行末はそのままにしておく必要があります...</rant>

    変更方法については、 https:core.autocrlf //help.github.com/articles/dealing-with-line-endingsを参照してください。ただし、github は私とは異なる方法を推奨していることに注意してください。したがって、これは議論中であり、走行距離は異なる場合があります...

  • NuGet は、事前にパッケージ化された (バイナリ) データをダウンロードするある種のパッケージ マネージャーのようです。このバイナリ データをコミットしています。これは難しいエラーではありませんが、@Cupcake と私は、長期的には満足できないと予測しています。

    jQuery やブートストラップなどの小さなものについては、おそらく問題なく、git に実際に負担をかけずにデプロイを簡素化できますが、git はバイナリ blob をあまり好きではありません。ポイントは明らかになり、最終的には最悪です。壊れることはありませんが、git エクスペリエンスを台無しにしてしまいます。

    バイナリを追跡する他の方法を検討する必要があります。NuGet では、レポをデプロイ/クローンする場所ならどこでも NuGet を実行するのが妥当と思われますが、バイナリ メディア アセット (ゲーム開発など) では、git の状況はさらに悲惨です。

よろしくお願いします

于 2013-09-06T08:46:22.383 に答える