2016-10-19 11 views
0

私はgitの作業を追跡して、プロダクションと作業ブランチを持つようにしてきました。私はとてもうまく行っていませんでした。 (私は前に触れたことがありません)GitのGUIを使用して私はこのような私の履歴loksを決定:gitを単に作業ブランチとプロダクションブランチにするにはどうすればよいですか?

GIT

私は3本の枝になってしまったかどうかはわかりませんが、私は1つが私のローカルコピーであると考えてい?ここで取得する

私の手順は

$ git checkout origin/production 
$ git reset --hard {{hash of commit I want production to be at}} 
    HEAD is now at {{hash}} {{commit}} 
$ git add . 
$ git commit -m "created production branch" 
$ HEAD detached from origin/production 
    nothing to commit, working tree clean 
$ git push origin production 
    error: src refspec production does not match any. 
    error: failed to push some refs to 'https://github.com/{{username}}/{{git}} 

いくつかの警告は、彼らが何を意味するか/修正する方法がわからないがありましたか?私は最初からやるべき何

+0

あなたは枝の上に、現在ではありません(»切り離さヘッド«)。トラッキングブランチ( 'git checkout --track origin/whatever')が必要な場合や、' git checkout -b whatever'という新しいブランチを作成した場合、 'git push origin production 'を受け取った後に – escitalopram

+0

を実行した場合、https:// githubに移動します。 co.jp/chevalierc/{repo} .git ! [拒否]生産 - >生産(非早送り) エラー: 'https://github.com/chevalierc/{repo}.git'にいくつかの参照をプッシュできませんでした。 ヒント:あなたの現在の支店が遅れています ' –

答えて

0

$ git checkout -b production2 {{hash of commit I want}}

と私のミスをクリーンアップするために私がした以下:

$ git push origin --delete production 
$ git branch -m production2 production 
$ git push origin production 
$ git push origin --delete production2 
+0

これはあなたの質問に対する有効な回答ですか? – Marusyk

+0

はい、私自身の答え –

関連する問題