We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b8d49c9 commit 52a78f2Copy full SHA for 52a78f2
bin/git_fresh
@@ -5,11 +5,15 @@ if ! command -v git >/dev/null 2>&1; then
5
exit 1
6
fi
7
8
+branch="${1:-"master"}"
9
+
10
+echo "Refresing branch ${branch}"
11
12
git fetch --all
-git checkout --quiet origin/master
-git branch -D master
-git checkout -b master
-git branch -u origin/master
13
+git checkout --quiet "origin/${branch}"
14
+git branch -D "${branch}"
15
+git checkout -b "${branch}"
16
+git branch -u "origin/${branch}"
17
git submodule update --init --recursive
-git branch | grep -v -E "(^\*|master|remotes)" | xargs git branch -D
18
+git branch | grep -v -E "(^\*|${branch}|remotes)" | xargs git branch -D
19
rm -rf ./**/*.orig || true
0 commit comments