0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

「git push -u origin --all」実行時にrejectedされてしまう

Posted at

#Ruby on Rails チュートリアルの「1.4 Gitによるバージョン管理」でつまづいた
Bitbucketへの接続は問題ないし、SSHの認証鍵やプロジェクトを再作成しても
「git push -u origin --all」がうまくいかない...。

Bitbucketへのリポジトリ追加とリポジトリへのプッシュ
$ git remote add origin git@bitbucket.org:ユーザー名/hello_app.git
$ git push -u origin --all
To bitbucket.org:ユーザー名/hello_app.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'git@bitbucket.org:ユーザー名hello_app.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

#結論
「-u」ではなく「-fu」を指定したところ解消

-fuへ変更
$ git push -fu origin --all
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?