0
私は既存のレポを持っています。私は既存のレポの特定のブランチに新しいファイルをプッシュ
git init
git add .
git commit -m "second commit"
git remote add origin http://github.com/myusername/abc/tree/otherbranch
しかしgit checkout otherbranch
を試してみましたotherbranch
と呼ばれる私のレポの非masterブランチにいくつかの新しいファイルをプッシュすることは
error: pathspec 'otherbranch' did not match any file(s) known to git.
とgit push origin otherbranch
が
error: src refspec otherbranch does not match any.
error: failed to push some refs to 'https://github.com/myusername/abc/tree/otherbranch'
を与えています
私は間違って何をしていますか?
' gitの:リポジトリ「をhttp://github.com/ myusername/abc/tree/otherbranch/'not found' – user5739619
あなたが正しいです - 起源の場所が間違っています、それは 'https:// github.com/myusername/abc.git'のように見えるはずです。ブランチ名は含めないでください。 (原点の問題に気づくために@anoeに寄付をしています)正しい原点を設定したら、まだ取り出す必要があります。 – manannan
'git remote add origin https:// github.com/myusername/abc.git'と入力すると' fatal:remote origin already exists'と表示されます。 'git fetch'を実行しようとすると' fatal:repository 'https://github.com/myusername/abc' not found'と表示されます – user5739619