Version control is essential for any professional project. It allows you to safely track changes, revert mistakes, and sync your code seamlessly between your local computer and the cloud server. This project leverages Git.
1. Initializing the Repository
Navigate to the project directory in your terminal and initialize a completely new git repository.
git initIt is important to create a .gitignore file to prevent sensitive files (like database credentials inside config.php or the actual database structure .sql) from being accidentally uploaded to a public hub.
echo "config.php" >> .gitignore2. Committing the Codebase
With the gitignore protecting sensitive data, add all of your HTML, CSS, Javascript, and PHP files to the staging area and commit them.
Placeholder: Take a screenshot of the terminal committing files locally.
git add .git commit -m "Initial commit of website codebase"3. Pushing to GitHub (or GitLab)
Create a new repository on your GitHub account. Then, link your local codebase to that remote repository and push your commit to the cloud.
Placeholder: Take a screenshot of your GitHub repository populated with the project files.