2014年7月10日木曜日

git pushした後にcommit --amendしてpushしてみた

 コミット時のコメントを間違ってしまったのにpushしてしまって、amendしてもう一回pushしたらrejectされた。まぁ、当然ですよね。
~/work/awesome_events$git push
To https://github.com/xxx/awesome_events.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/xxx/awesome_events.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.
~/work/awesome_events$gi pull
-bash: gi: command not found
~/work/awesome_events$git pull
Merge made by the 'recursive' strategy.
~/work/awesome_events$
別に何か対処した訳でもなく、あんたのブランチが古いからgit pullしてみろ、とヒントが書かれているので言う通り実行すると、 再帰的にマージしといたよというメッセージ。
 その後pushできましたが、誤ったコミット、修正後のコミット、そのときに自動で発生したマージ処理についてMerge branch 'master' of https://github.com/xxx/awesome_eventsというコメントとともにコミットが追加されていました。

 あぁ、こうなっちゃうのね。意図したこととは違ったけど、データが壊れていないのでよしとする。でも誤ったコメントが入ったままなのは今後なんとかしないと。

0 件のコメント:

コメントを投稿