Git: Branches — различия между версиями
Материал из База знаний QPAM
(Новая страница: «* Обновить все локальные ветки по remote-веткам <syntaxhighlight lang="bash"> #!/bin/sh git for-each-ref --shell --format="%(r…») |
(нет различий)
|
Версия 15:26, 7 марта 2024
- Обновить все локальные ветки по remote-веткам
#!/bin/sh git for-each-ref --shell --format="%(refname:short)" refs/heads | tac | tr -d "'" | while read branch_name; \ do echo ${branch_name} git checkout ${branch_name} git pull done git checkout master # rebase all but master: git checkout master; git fetch origin --prune; git merge; for branch_name in $(git for-each-ref --shell --format='%(refname:short)' refs/heads | head -n -1 | tac | xargs); do git checkout ${branch_name}; git rebase master; git push origin -f; done; git checkout master