とあるエンジニアの闇歴史帳

コピペで使える便利Wiki ※現在構築中です。

ユーザ用ツール


サイドバー

言語

サーバ関連

ツール

API

読み物

その他

git:git_error1

初回の git push でエラーが出る場合の対処法

commitを行いまっさらなリポジトリに意気揚々とgit pushをかけようとすると、以下のようなエラーが出る場合があります。

fatal: The remote end hung up unexpectedly

$ git push
No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as 'master'.
fatal: The remote end hung up unexpectedly
error: failed to push some refs to 'ssh://git.example.org:50022/reposgit/endymion.git'

git push origin master

このエラーは一体どこにファイルをアップすればいいの?という意図になりますので、「git push」のあとに当該部分を指定してやれば解決します。

$ git push origin master
Counting objects: 190, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (186/186), done.
Writing objects: 100% (190/190), 270.51 KiB, done.
Total 190 (delta 34), reused 0 (delta 0)
To ssh://git.example.org:50022/reposgit/endymion.git
 * [new branch]      master -> master

originは接続先のサーバの略称、 masterはデフォルトのブランチ名にあたります。

2回目以降はgitがいい感じに処理してくれますので、必要がなければ指定しなくて大丈夫です。

$ git push
Everything up-to-date

参考

= Git超入門:"git push origin master"の"push"と"origin"と"master"の意味がわからないあなたへ : http://dqn.sakusakutto.jp/2011/10/git_push_origin_master.html

関連書籍

failed to fetch data: unkown error

failed to fetch data: unkown error

failed to fetch data: unkown error

failed to fetch data: unkown error

関連ページ

git/git_error1.txt · 最終更新: 2020/06/23 14:10 (外部編集)