This repository is now deprecated and has been integrated into the Project_Starter_Script Repository
A simple, interactive shell script to automate the best-practice steps for starting a new task in a Git repository.
Every new piece of work (a feature, a bugfix) should start from an up-to-date main branch and be isolated in its own new branch. Forgetting to git pull or creating a branch from a stale one can cause merge conflicts and other headaches.
This script prevents those mistakes by turning a multi-step process into a single, guided command.
When you run the script, it will:
- Check for uncommitted changes to make sure your work is saved.
- Prompt you to enter a descriptive name for your new branch.
- Automatically switch to your main branch (
mainormaster). - Pull the latest changes from the remote to ensure your local version is up-to-date.
- Create and switch to your new branch.
You're left with a fresh, clean branch, ready for you to start coding.
There are two ways to use this script.
- Download or copy the
start-work.shfile into the root directory of your project. - Make it executable (you only have to do this once per project):
chmod +x start-work.sh
This method lets you run the start-work command from the terminal in any Git repository on your system.
- Download
start-work.shto a common location, like yourDownloadsfolder. - Make it executable:
chmod +x ~/Downloads/start-work.sh - Move it to a location in your system's PATH.
/usr/local/binis a common choice.Now you can run the command as justsudo mv ~/Downloads/start-work.sh /usr/local/bin/start-workstart-workinstead of./start-work.sh.
The script defaults to using main as the primary branch name. If you still use master or another name, you can change it by editing this line at the top of the script:
# Set the default main branch name. Change if you use "master".
MAIN_BRANCH="main"- Navigate to your project's directory in your terminal.
- Run the script.
- If installed locally:
./start-work.sh - If installed globally:
start-work
- If installed locally:
- Follow the on-screen prompt to enter your new branch name, and the script will handle the rest.
This project is licensed under the MIT License.