Overview
- Git course
- Intermediate
- Lesson 74/82
- 4 min
See the team repository workflow steps.
Team repository workflow
In a team repository, multiple developers work on the same project. Each developer completes their task on a separate branch and pushes their changes to the remote repository. A pull request is then opened, the code is reviewed, and approved changes are merged into the main branch.
Take a task
↓
Create a branch
↓
Develop code
↓
Push and PR
↓
Review and mergeFrom task to review
When a task is completed, the developer commits the changes and pushes their branch to the remote repository. A pull request allows the team to review these changes. Based on the review, necessary corrections can be made or the changes can be approved.
git add .
git commit -m "feat: add profile page"
git push -u origin feature/profile-pagePractice Arrange the team workflow
Represent the team repository process from taking a task to requesting a merge in five lines. Print the steps in this order: take a task, create a branch, commit, push, and pull request.
Starter code
// Ekip iş akışını sırayla yazdırSample solution
print("Take task")
print("Create branch")
print("Commit changes")
print("Push branch")
print("Open pull request")Expected output
Take task Create branch Commit changes Push branch Open pull request
Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 What is the main advantage of completing a developer's task on a separate branch?
- Completely resetting commit history
- Directly deleting other developers' work
- Developing changes independently of the main branch Correct answer
- Automatically removing the remote repository
Explanation: Separate branches allow developers to complete tasks without directly affecting each other's work.
2 Push the team branch to the remote
git push -u origin ____
git push -u origin feature/profile-page
Explanation: The feature branch is pushed to origin, and the -u option establishes an upstream tracking relationship.
3 Team workflow concepts
| Term | Meaning |
|---|---|
Görev |
Work assigned to a developer |
Özellik dalı |
Independent development area |
Pull request |
Request to review changes |
Onay |
Permission to merge |