新しいレールアプリを既存のサンプルリポジトリに追加しようとしています。私は前にこれをやった。私はRails 5.1.4とgit 2.11.0を使ってGoogle Cloud Platform Compute Engineインスタンスで現在のDebianを使用しています。新しいレールアプリから指定されたリモートリポジトリがありません
つまり、私は新しいレールアプリを追加できますが、そのアプリケーションのディレクトリの中からを追加/コミット/プッシュしようとすると、エラーが発生します。アプリケーションのトップレベルディレクトリの上から追加/コミット/プッシュすると、すべて動作します。
これを再作成するのは簡単です。私は:
rails new foo
新しいレールアプリを作成します。私はその後、アプリを追加コミット、およびプッシュ:
次の出力(省略)になりgit add .
git commit -m "testing"
git push
:
[master 95cb836] testing
76 files changed, 1197 insertions(+)
create mode 100644 railapps/foo/.gitignore
create mode 100644 railapps/foo/Gemfile
...
私は何の問題を持っていないこの時点で。しかし、私はそのアプリに移動して、プルまたはプッシュをしようとするとき、私は次のエラーを取得:
git pull
fatal: No remote repository specified. Please, specify either a URL or a
remote name from which new revisions should be fetched.
git push
Either specify the URL from the command-line or configure a remote repository using
git remote add
and then push using the remote name
git push <name>
OKを、十分に簡単、ちょうど、リモートを指定します?その結果
git remote add origin [email protected]:pathto/myrepo.git
git push --set-upstream origin master
:
error: src refspec master does not match any.
error: failed to push some refs to '[email protected]:pathto/myrepo.git'