Git: Branches
Материал из База знаний QPAM
Версия от 15:31, 7 марта 2024; A via Felix! (обсуждение | вклад)
Обновить все локальные ветки по remote-веткам
#!/bin/sh #update all local branches by remotes 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 всех локальных веток по remote-веткам
#!/bin/sh # 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