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
|
||||
else
|
||||
echo "[*] Deployment branch $1 exists, pulling changes from remote"
|
||||
git pull origin $1 --force
|
||||
git checkout $1
|
||||
git fetch origin $1
|
||||
git switch $1
|
||||
fi
|
||||
|
||||
git rm -rf .
|
||||
|
@ -114,6 +114,7 @@ deploy() {
|
|||
git add --all
|
||||
if [ -n $(git status --porcelain) ];
|
||||
then
|
||||
echo "[*] Repository has changed, committing changes"
|
||||
git commit \
|
||||
--author="$3" \
|
||||
--message="new deploy: $(date --iso-8601=seconds)"
|
||||
|
|
Loading…
Reference in New Issue