私はこのgitのことをしようとしていると私は台無しだと思います。だから私は私のコンピュータにFooというプロジェクトを持っています。そのプロジェクトにディレクトリを変更しました。それから、git initを実行してからgit commitを実行してください。それはサーバーにいくつかのリファレンスをプッシュするために失敗したので、私はそれをgoogled、誰かが私は最初にgitをプルする必要があると述べた。さて、私はProject Fooのディレクトリにいる間、私のgithubサーバからgit pull要求を出しました。私のプロジェクトFooディレクトリ内のすべてのファイルが削除され、git pull要求のファイルのみがProject Fooのディレクトリに保存されます。gitで問題が発生しました。プロジェクトファイルを誤って削除しましたか?
ヘルプ、ファイルを再度取得するにはどうすればよいですか?
編集:ここでは、端末の歴史、http://codepad.org/cg9Gi7Iiある - 姿を消したファイルがあるポイントを中心にそのログからのコマンド:
$ ls
Models css js utils
README index.html styles
$ git init
Initialized empty Git repository in /Users/MacBoss/Documents/workspace/BlackboardCanvas/.git/
$ git add .
$ git remote add origin [email protected]:dchhetri/Demo-s.git
$ git push origin master
error: src refspec master does not match any.
error: failed to push some refs to '[email protected]:dchhetri/Demo-s.git'
$ git remote add origin [email protected]:dchhetri/Demo-s.git
fatal: remote origin already exists.
$ git push origin master
error: src refspec master does not match any.
error: failed to push some refs to '[email protected]:dchhetri/Demo-s.git'
$ git pull failed to push some refs to '[email protected]:dchhetri/Demo-s.git'
fatal: 'failed' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
$ git pull
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From github.com:dchhetri/Demo-s
* [new branch] master -> origin/master
You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.
If you often merge with the same branch, you may want to
use something like the following in your configuration file:
[branch "master"]
remote = <nickname>
merge = <remote-ref>
[remote "<nickname>"]
url = <url>
fetch = <refspec>
See git-config(1) for details.
$ git pull failed to push some refs to '[email protected]:dchhetri/Demo-s.git'
fatal: 'failed' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
$ git pull [email protected]:dchhetri/Demo-s.git
From github.com:dchhetri/Demo-s
* branch HEAD -> FETCH_HEAD
$ ls
AStarDemo.jar
'git pull'のほかに、他のコマンドを実行しましたか? – ctcherry
これは私がやったことです、git init、そしてREADMEに触れてからgit commitしてからgit remote origin [email protected]:dchhetri/Demo-s.gitを実行し、git push masterを実行しました。サーバー、私はgitを引っ張ったので、私のファイルがなくなった。また、以前はrm -r .gitを実行してFooのプロジェクトディレクトリから.gitフォルダを削除したことを追加したいと思っています。 – dchhetri
私はターミナル履歴を追加しました。これは以前にプルリクエストの前にすべてのファイルがあったことを示しています。 – dchhetri