Prompt Detail:
Scenario:
Person 1 (Master):
You are a master developer tasked with creating a project and uploading it to GitHub. You have a clear vision for the project, and you want to ensure that it is well-organized and documented. Here are the steps you need to follow:
Create a New GitHub Repository:
- Go to GitHub and log in to your account.
- Click on the '+' sign in the upper right corner and select "New repository."
- Fill in the repository name, description, and other relevant information.
- Choose your preferred settings for the repository (public or private).
- Click "Create repository."
Initialize the Project:
- Create a local directory on your computer where you will work on the project.
- Use version control (e.g., Git) to initialize the project. You can do this with the following commands:bash
git init git add . git commit -m "Initial commit"
Connect to GitHub:
- Link your local project to the GitHub repository you just created by setting the remote repository as the origin:bash
git remote add origin <repository_URL>
- Link your local project to the GitHub repository you just created by setting the remote repository as the origin:
Push the Project to GitHub:
- Push your project to GitHub:bash
git push -u origin main
- Push your project to GitHub:
Share the Repository:
- Share the GitHub repository URL with the developer who will be working on it.
Person 2 (Developer):
You are a developer assigned to work on the project. Your tasks involve downloading the project, making changes on the developer branch, discussing and merging changes with the master, and applying the changes to the main project. Here's what you need to do:
Clone the Repository:
- Open your terminal or Git client.
- Clone the master's repository to your local server:bash
git clone <repository_URL>
Create a Developer Branch:
- Create a new branch for your work. It's a good practice to work on a separate branch:bash
git checkout -b developer
- Create a new branch for your work. It's a good practice to work on a separate branch:
Make Changes:
- Make the necessary changes to the project in your local working directory.
Commit Your Changes:
- Stage your changes and commit them:bash
git add . git commit -m "Your commit message"
- Stage your changes and commit them:
Discuss Changes with the Master:
- Push your developer branch to GitHub:bash
git push origin developer
- Open a pull request on GitHub and initiate a discussion with the master about your changes.
- Push your developer branch to GitHub:
Merge Changes:
- After the master approves your changes, merge your developer branch into the main project:
- The master may merge the changes via the GitHub interface or command line.
- After the master approves your changes, merge your developer branch into the main project:
Apply Changes to the Main Project:
- Pull the updated main project to your local repository:bash
git checkout main git pull origin main
- Pull the updated main project to your local repository:
Push Changes to GitHub:
- Push the updated main project to GitHub:bash
git push origin main
- Push the updated main project to GitHub:
Provide Screenshot:
- Take a screenshot of your commits and pull request discussion on GitHub to show the progress and communication with the master.
This scenario outlines the workflow for a master and developer collaborating on a project using Git and GitHub. It emphasizes the importance of version control and communication throughout the development process.