Jak wcisnąć lokalną gałąź Git do gałęzi master w zdalnym?

Mam gałąź o nazwie develop w moim lokalnym repo i chcę się upewnić, że kiedy wcisnę ją do origin, zostanie ona połączona z origin / master. Obecnie, kiedy naciskam, jest dodawany do zdalnej gałęzi rozwoju.

Jak mogę to zrobić?

Author: hmijail, 2011-03-24

2 answers

$ git push origin develop:master

Lub bardziej ogólnie

$ git push <remote> <local branch name>:<remote branch to push into>
 658
Author: mipadi,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-01-26 18:33:01

Jak ludzie wspominali w komentarzach, prawdopodobnie nie chcesz tego robić... Odpowiedź od mipadi jest absolutnie poprawna, jeśli wiesz, co robisz.

Powiedziałbym:

git checkout master
git pull               # to update the state to the latest remote master state
git merge develop      # to bring changes to local master from your develop branch
git push origin master # push current HEAD to remote master branch

 

 161
Author: Eugene Sajine,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2015-07-29 20:17:23