This template should help get you started developing with Vue 3 in Vite.
To set up a Git hook on Windows that prompts you before pushing to the master
branch (or any other branch you want to protect), you can create a pre-push hook. This hook will run before any push command and can be used to display a warning or even prevent the push unless you explicitly confirm it.
Here’s how to set it up:
Open your terminal (Command Prompt, Git Bash, or any terminal that you prefer) and navigate to your Git repository:
cd path/to/your/repository
In your Git repository, navigate to the .git/hooks
directory:
cd .git/hooks
Create a new file named pre-push
(without any extension). You can do this using any text editor or the terminal:
touch pre-push
Open the pre-push
file in your favorite text editor and add the following script:
#!/bin/bash
# Get the name of the branch you are pushing to
current_branch=$(git rev-parse --abbrev-ref HEAD)
# Check if the branch is 'master'
if [ "$current_branch" == "master" ]; then
echo "You are about to push to the master branch."
read -p "Are you sure you want to continue? (yes/no): " choice
if [ "$choice" != "yes" ]; then
echo "Push aborted."
exit 1
fi
fi
# Allow the push to proceed
exit 0
Ensure the script is executable by running the following command:
chmod +x .git/hooks/pre-push
Now, when you try to push to the master
branch, the hook will trigger and prompt you for confirmation. If you type yes
, the push will proceed. If you type anything else, the push will be aborted.
-
You make some changes to your code.
-
You commit those changes.
-
You attempt to push to
master
:git push origin master
-
You will see the prompt:
You are about to push to the master branch. Are you sure you want to continue? (yes/no):
-
If you type
yes
, the push proceeds. If you typeno
, the push is aborted.
This simple hook script ensures that you always get a warning before pushing changes directly to master
, helping you avoid accidental updates.
Making request to the server, getting the data and displaying it in the UI by using loops
- Auth system : User should be logged in to using an API auth or firebase auth to view his data
- Roles and permissions : All users will be assigned a particular role like
admin
,customer
, enable them to view their own data - More user friendly errors, warnings, success messages : We will
vue-toastification
package for success messages or error messages, and for prompts we will use swal - Appearance and design : The design will be more nice and user friendly, it will look like a whole new application and create its pages like home, contact, view, map, privacy policy etc
- the students data will not be json-server : The database will not be json server, we will use firebase or mongodb for this purpose
Youtube Video I'm watching to build this project | Geeks for Geeks