Version Control (Git)

This outline covers how to manage the website’s source code using Git. This includes creating branches, merging changes, and resolving conflicts.

Using Git for Website Management

The website uses Git for version control, allowing for tracking changes, collaboration, and managing different versions of the code.

Branches

Branches are used to isolate new features, bug fixes, or experimental changes from the main codebase. They allow developers to work independently and merge their changes back into the main branch once they are complete.

Example:

git checkout -b feature/new-section
          

This command creates a new branch called “feature/new-section” based on the current branch and switches to that branch.

Merging Changes

Once changes are made in a branch, they can be merged back into the main branch using the git merge command.

Example:

git checkout main
          git merge feature/new-section
          

This merges the “feature/new-section” branch into the “main” branch.

Resolving Conflicts

Conflicts can occur when changes made in two different branches affect the same lines of code. Git will flag these conflicts, and developers need to manually resolve them before merging the branches.

Example:

git merge feature/new-section
          

This command might result in a merge conflict. You will need to manually resolve the conflict by editing the affected file and then committing the changes.

Committing Changes

When changes are made to the code, they need to be committed to the local repository using the git commit command. Commit messages should be clear and concise, explaining the purpose of the changes.

Example:

git commit -m "Added a new section to the homepage"
          

Pushing Changes

After committing changes to the local repository, they need to be pushed to the remote repository using the git push command.

Example:

git push origin main
          

This pushes the changes made in the “main” branch to the remote repository on the “origin” server.

References

Top-Level Directory Explanations

src/ - This directory contains the source code for the Cilium project.

src/components/ - This directory contains components used in the project.

src/hooks/ - This directory contains hooks used in the project.

src/layouts/ - This directory contains the layouts used for the project’s website.

src/pages/ - This directory contains the pages for the project’s website.