We will use Git for version control to track changes in our code and collaborate effectively. This README will guide you through the basics of using Git, ensuring everyone can contribute smoothly.
Make sure Git is installed on your computer. You can download it from git-scm.com.
To start working on the project, you'll need to clone the repository to your local machine. Open your command line or terminal and run the following command:
git clone https://github.com/bvechiato/moss-cw2
Change into the project directory using:
cd moss-cw2
- Before starting new work, always pull the latest changes from the remote repository to ensure you have the most up-to-date version:
git pull
- If you're working on a new feature or significant changes, it's a good practice to create a new branch:
git checkout -b [branch-name]
Replace [branch-name] with a descriptive name for your task.
- You can check the status of your files using:
git status
This command shows you which files are modified, staged, or untracked.
- After modifying your files, "stage" them for commit:
git add .
- Once your changes are staged, commit them with a descriptive message:
git commit -m "Description of changes made"
- To share your changes with the team, push your commits to your branch:
git push
- After finishing work on a branch, you can merge it back into the main branch:
First, switch to the main branch:
git checkout main
Then, merge your branch:
git merge [branch-name]
- Commit frequently: make small, frequent commits with descriptive messages.
- Pull regularly: pull changes from the main branch often to minimise conflicts.
- Use meaningful branch names: name branches descriptively to indicate their purpose (e.g., feature/add-agent-attributes).