We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f58b2c commit 8dae956Copy full SHA for 8dae956
deploy.sh
@@ -21,9 +21,6 @@ set_user_id() {
21
}
22
23
previous_branch=`git rev-parse --abbrev-ref HEAD`
24
-if [[ $previous_branch = "HEAD" ]]; then
25
- previous_branch=$commit_hash
26
-fi
27
28
if ! git diff --exit-code --quiet --cached; then
29
echo Aborting due to uncommitted changes in the index
@@ -47,5 +44,11 @@ else
47
44
git push origin $deploy_branch
48
45
fi
49
46
50
-git symbolic-ref HEAD refs/heads/$previous_branch
+if [[ $previous_branch = "HEAD" ]]; then
+ #we weren't on any branch before, so just set HEAD back to the commit it was on
+ git update-ref --no-deref HEAD $commit_hash $deploy_branch
+else
51
+ git symbolic-ref HEAD refs/heads/$previous_branch
52
+fi
53
+
54
git reset --mixed
0 commit comments