git
チーム環境でコードを管理するために現在それを使用しているのは、かなり新しいです。リベースの問題がいくつかあり、を使用して修正しました
git checkout --ours filename.txt
git add filename.txt
git rebase --continue
変更をプッシュしたいので、次のコマンドを実行します
$ git push origin feature/my_feature_branch
次のエラーが発生します。
To ssh://[email protected]:7999/repo/myproject.git
! [rejected] feature/my_feature_branch -> feature/my_feature_branch (non-fast-forward)
error: failed to push some refs to 'ssh://[email protected]:7999/repo/myproject.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
エラーを取り除くにはどうすればよいですか?
PS:私は--force
可能な限りオプションを使用することを避けています。
誰かがあなたの最後git fetch
との間で新しいコミットをプッシュしたようgit push
です。この場合、手順を繰り返して、my_feature_branch
もう一度リベースする必要があります。
git fetch
git rebase feature/my_feature_branch
git push origin feature/my_feature_branch
その後、でgit fetch
状況を調べることをお勧めしgitk --all
ます。
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加