[go: up one dir, main page]

0% found this document useful (0 votes)
27 views3 pages

Git Local and Global Assignment

Uploaded by

hamidsaif214
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views3 pages

Git Local and Global Assignment

Uploaded by

hamidsaif214
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Git Local and Git Global: Scenario-

Based Assignment
Introduction:
In this assignment, you will work in groups to manage a project using Git, both locally and
globally. You will be divided into three teams of four students each. Your task is to
collaboratively develop a project, practicing various Git commands and workflows. Each
team will be responsible for different parts of the project, and you will need to merge your
work into a central repository.

Scenario:
You are part of a software development team tasked with creating a website for a local
business. The project requires collaboration, version control, and regular updates. You will
use Git to manage your code locally on your machines and globally on a shared GitHub
repository.

Teams:
Team 1: Frontend Development
- Alice
- Bob
- Charlie
- David

Team 2: Backend Development


- Eve
- Frank
- Grace
- Heidi

Team 3: Database and Integration


- Ivan
- Judy
- Mallory
- Niaj
Tasks:

Task 1: Setting Up Local Repositories


Each team member will set up a local Git repository on their machine.

1. Create a new directory for your project: `mkdir project_name`


2. Navigate to the project directory: `cd project_name`
3. Initialize a Git repository: `git init`
4. Create a README file and make your first commit:
- `echo '# Project Title' > README.md`
- `git add README.md`
- `git commit -m 'Initial commit'`
5. Set up a connection to the remote repository on GitHub:
- `git remote add origin <repository_url>`
- `git push -u origin master`

Task 2: Collaborative Work


Each team will work on their assigned part of the project and commit their changes
regularly. Use branches to manage your work.

1. Create a new branch for your task: `git checkout -b feature_branch`


2. Work on your task and commit changes:
- `git add .`
- `git commit -m 'Describe your changes'`
3. Push your branch to the remote repository: `git push origin feature_branch`
4. Create a pull request on GitHub to merge your changes into the master branch.

Task 3: Merging Changes


Collaborate with other teams to merge changes into the master branch. Resolve any
conflicts that arise.

1. Review pull requests from other teams on GitHub.


2. Resolve any merge conflicts locally:
- Fetch the latest changes: `git fetch origin`
- Merge changes into your branch: `git merge origin/master`
- Resolve conflicts, if any: `git add .`
- Commit the merge: `git commit -m 'Resolved merge conflicts'`
3. Push the resolved changes to the remote repository: `git push origin feature_branch`
4. Once all conflicts are resolved, merge the pull request on GitHub.

Task 4: Finalizing the Project


Ensure that all parts of the project are integrated and functioning correctly. Prepare the
final version for deployment.
1. Merge all feature branches into the master branch.
2. Test the integrated project to ensure all components work together.
3. Push the final version to the remote repository.
4. Tag the final version: `git tag -a v1.0 -m 'Final version'`
5. Push tags to the remote repository: `git push origin --tags`

You might also like