私はコードに新しく、GitHubのレポにテキストファイルをプッシュしようとしていましたが、同じエラーが発生しています。git pushの使用に問題があります
私はGitのプッシュを使用すると、私は次のエラーを取得する:
$ git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin master
それから私はGitのプッシュ--set-上流の原点マスターをして、この応答を取得:
$ git push --set-upstream origin master
To https://github.com/KMagrane/test-repo.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/KMagrane/test-
repo.git'
hint: Updates were rejected because the tip of your current branch is
behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for
details.
だから私はgitのを試してみましたこの応答を得る:
$ git pull origin master
From https://github.com/KMagrane/test-repo
* branch master -> FETCH_HEAD
fatal: refusing to merge unrelated histories
私はそれ以外のファイルをプッシュしようとするのか分からないo私のレポ。どんな助けでも大歓迎です!
あなたの現在の 'master'ブランチはどうでしたか?リモートリポジトリをクローンしましたか? –
私はリモートリポジトリをクローンしました – KMagrane
あなたのエラーは、Gitがリモートリポジトリをあなたのローカルリポジトリと関係があると認識しないことを意味します。これを保存する方法があるかもしれませんが、私はもう一度クローンを作成するかもしれません。 –