-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0881813
commit 12e2da2
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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." |