dotfiles

Форк
0
/
git-rename-branch 
20 строк · 550.0 Байт
1
#!/bin/bash
2

3
# Rename the local branch to the new name
4
git branch -m $1 $2
5

6
# Delete the old branch on remote - where <remote> is, for example, origin
7
git push origin --delete $1
8

9
# Or shorter way to delete remote branch [:]
10
git push origin :$1
11

12
# Prevent git from using the old name when pushing in the next step.
13
# Otherwise, git will use the old upstream name instead of <new_name>.
14
git branch --unset-upstream $2
15

16
# Push the new branch to remote
17
git push origin $1
18

19
# Reset the upstream branch for the new_name local branch
20
git push origin -u $1
21

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.