2014-02-11 43 views
0

我有兩個分支,主人和測試。在測試中,我做了一些與主站衝突的更改。現在我無法合併它們。但是當我推送到heroku和github時,我總是推動主分支。有沒有什麼方法可以覆蓋這個,並使測試分支是用於推送等的分支?如何使測試分支被推到git的主分支?

謝謝!

+0

什麼是您用來推送的thye命令。它只是git推? – BRjava

回答

0

當然,您將更改合併到主。你只需要解決的矛盾:

$ git checkout master 
$ git merge testing 
$ edit file-with-conflict 
$ git add file-with-conflict 
$ git commit 

或者,如果你認爲你的「主人」分支中的文件是正確的,你只是要放棄你的主分支衝突的變化:

$ git checkout master 
$ git merge -X theirs testing 

做什麼你問(推測試分支Heroku的),你可以這樣做:

$ git checkout testing 
$ git push origin master 

這將在遠程命名爲「原點」當前的分支推到「主」分支( whic我假設你的英雄遙控器被稱爲)。您可以通過添加「-u」使其成爲默認值:

$ git push -u origin master 
+0

真棒謝謝! – google1254