私は新しい機能を開発しましたが、マスターブランチにローカルにコミットするのは複雑すぎることに気付きました。次のようにこのように、私は新しいブランチを作成しました:私は新しいブランチをプルしないでどのようにプッシュしますか
$ git stash branch project_0.2 [email protected]{0}
もちろんの問題は、私は私が手にサーバーに新しいブランチをプッシュしようとすることです:
$ git push origin master
To https://svn.tudelft.nl/git/project.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://svn.tudelft.nl/git/project.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and 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.
私が見てきましたインターネットとどこでも私はgit pull
と変更をマージする必要があります参照してください。 (私はバックアップを作成する前に)私はこれを試みたが、私が取得:
$ git pull
remote: Counting objects: 1105, done.
remote: Compressing objects: 100% (304/304), done.
remote: Total 725 (delta 501), reused 552 (delta 382)
Receiving objects: 100% (725/725), 5.29 MiB | 0 bytes/s, done.
Resolving deltas: 100% (501/501), completed with 165 local objects.
From https://svn.3me.tudelft.nl/git/project
5d6516c..fd424b5 master -> origin/master
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> project_0.2
私は停止して、私はここで何をすべきかわかりません。また、変更はとても深く、私は永遠に合併するだろう。ブランチをサーバーにプッシュするよりスマートな方法があると私は考えました。このようにして、コードを修正する際に私のチームの他のメンバーから助けを得ることができます。これは可能ですか?
「gitのプッシュ原点」を配置する必要がプッシュするためにあなたがして、あなたのブランチを作成しました最も奇妙な方法。いずれにしても、典型的なワークフローは新しいブランチをプッシュし、プルリクエストを作成して「マスター」に戻すことです。答えを与えるリスクが多すぎる。 –
@TimBiegeleisen [この回答](https://stackoverflow.com/a/30927991/611873)を読んだ後、良い解決策に思えました。 – aaragon
あなたがこのブランチで何をしたいかを教えてもらえれば、多分答えまたは示唆を与えることができます。 –