Created
November 14, 2015 14:31
-
-
Save xto3na/40c7770410226d3201e6 to your computer and use it in GitHub Desktop.
Git. Создание, удаление удаленной и локальной веток
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Надо добавить удаленную ветку, чтобы она синхронизировалась через pull/push. | |
Сначала надо создать удаленную ветку: | |
git push origin origin:refs/heads/new_branch_name | |
Стянуть ее | |
git pull origin | |
Посмотреть появилась ли в списке удаленных веток: | |
git branch -r | |
Создать локальную ветку и закрепить ее за удаленной | |
git checkout --track -b new_branch_name origin/new_branch_name | |
Удалить удаленную ветку можно так | |
git push origin :heads/new_branch_name | |
Локальная ветка автоматически создается, когда делаем | |
git checkout new_branch_name | |
Слить локальную ветку с удаленной можно так: | |
git checkout master | |
git merge new_branch_name | |
Удалить локальную ветку: | |
git branch -d new_branch_name | |
Полезные ссылки: | |
Про Git на пальцах (для переходящих с SVN) - http://habrahabr.ru/post/68341/ | |
Pro git - http://git-scm.com/book/ru/ | |
Git How To - http://githowto.com/ru/ | |
Магия Git - http://diseaz.github.io/gitmagic/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment