init
This commit is contained in:
18
pull.sh
Executable file
18
pull.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Define the branch name
|
||||
BRANCH_NAME="dev"
|
||||
|
||||
if [ ! $(git rev-parse --abbrev-ref HEAD) == $BRANCH_NAME ]; then
|
||||
|
||||
# Fetch the latest changes from the remote
|
||||
git fetch origin
|
||||
|
||||
# If the branch exists, just switch to it
|
||||
git switch $BRANCH_NAME || (git switch -c $BRANCH_NAME && git push -u origin $BRANCH_NAME)
|
||||
|
||||
fi
|
||||
|
||||
# get the latest changes
|
||||
git pull origin $BRANCH_NAME --ff-only
|
||||
|
||||
Reference in New Issue
Block a user