fix: git switch fetches remote branch if it doesn't exist on remote
automatically src: https://stackoverflow.com/questions/9537392/git-fetch-remote-branchmaster
parent
99b0d49f5c
commit
db1e89cd70
|
@ -104,8 +104,8 @@ deploy() {
|
||||||
git checkout --orphan $1
|
git checkout --orphan $1
|
||||||
else
|
else
|
||||||
echo "[*] Deployment branch $1 exists, pulling changes from remote"
|
echo "[*] Deployment branch $1 exists, pulling changes from remote"
|
||||||
git pull origin $1 --force
|
git fetch origin $1
|
||||||
git checkout $1
|
git switch $1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git rm -rf .
|
git rm -rf .
|
||||||
|
@ -114,6 +114,7 @@ deploy() {
|
||||||
git add --all
|
git add --all
|
||||||
if [ -n $(git status --porcelain) ];
|
if [ -n $(git status --porcelain) ];
|
||||||
then
|
then
|
||||||
|
echo "[*] Repository has changed, committing changes"
|
||||||
git commit \
|
git commit \
|
||||||
--author="$3" \
|
--author="$3" \
|
||||||
--message="new deploy: $(date --iso-8601=seconds)"
|
--message="new deploy: $(date --iso-8601=seconds)"
|
||||||
|
|
Loading…
Reference in New Issue