Skip to content

Commit

Permalink
branch setup
Browse files Browse the repository at this point in the history
  • Loading branch information
codingwithsurya committed Jun 17, 2023
1 parent 0881813 commit 12e2da2
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions create-branch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

branch_name=$1

# checks if branch name is provided
if [ -z "$branch_name" ]; then
echo "Error: Branch name not provided."
exit 1
fi

# Stash any local changes
git stash

# Switch to the 'nextjs' branch
git checkout nextjs

# Pull the latest changes from the remote 'nextjs' branch
git pull origin nextjs

# Create the new branch with the provided name
git checkout -b $branch_name

# Provide feedback to the user
echo "Branch '$branch_name' created successfully."

0 comments on commit 12e2da2

Please sign in to comment.