-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
56972aa
commit 4153eb3
Showing
2 changed files
with
29 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 @@ | ||
0 |
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,28 @@ | ||
#!/bin/bash | ||
|
||
# Define the name of the new branch | ||
NEW_BRANCH="new-branch" | ||
|
||
# Create and switch to the new branch | ||
git checkout -b $NEW_BRANCH | ||
|
||
# Perform the operations on the new branch | ||
# Exclude the .git directory and .env file from deletion | ||
find . -mindepth 1 -not -path "./build*" -not -path "./.git*" -not -name ".env" -exec rm -rf {} + 2>/dev/null | ||
|
||
# Move files and hidden files from the build directory to the current directory | ||
for file in build/.* build/*; do | ||
[ -e "$file" ] && mv "$file" . 2>/dev/null | ||
done | ||
|
||
# Remove the build directory if it is empty | ||
rmdir build 2>/dev/null | ||
|
||
# Add changes to the new branch | ||
git add . | ||
|
||
# Commit the changes | ||
git commit -m "Replace all contents with build folder contents except .env" | ||
|
||
# Optionally, push the new branch to the remote repository | ||
# git push origin $NEW_BRANCH |