Skip to content

Commit 6dab0da

Browse files
committed
push-lfs.sh - отправляет коммиты во все remote'ы (скрипт поддерживает Git LFS).
1 parent 7facea7 commit 6dab0da

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
| [show-changed-files.sh](show-changed-files.sh) | Показывает список изменившихся файлов в заданном диапазоне коммитов в пределах одной ветки. |
1010
| [find-changed-files.sh](find-changed-files.sh) | Показывает общий список изменившихся файлов для 2 веток в заданных диапазонах коммитов. |
1111
| [push-to-all-remotes.sh](push-to-all-remotes.sh) | Скрипт для ```push```'а ветки ```master``` во все ```remote```'ы. |
12+
| [push-lfs.sh](push-lfs.sh) | Отправляет коммиты во все remote'ы (скрипт поддерживает Git LFS). |

push-lfs.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
3+
readonly default_branch="master"
4+
5+
git remote show | while read remote_name; do
6+
push_url=$(git remote get-url --push $remote_name)
7+
8+
if [[ $push_url =~ "github" ]]; then
9+
provider="[email protected]"
10+
elif [[ $push_url =~ "gitlab" ]]; then
11+
provider="[email protected]"
12+
elif [[ $push_url =~ "bitbucket" ]]; then
13+
provider="[email protected]"
14+
fi
15+
16+
user_n_repo=$(echo "$push_url" | cut -d: -f2-)
17+
18+
echo "git push "$provider:$user_n_repo" $default_branch:$default_branch"
19+
git push "$provider:$user_n_repo" $default_branch:$default_branch
20+
done

0 commit comments

Comments
 (0)