Pull Requests
📄️ What is a Pull Request?
PR stands for "Pull Request," which means "a request to pull." It is a collaborative way of submitting code changes, widely used in team development and open-source projects. Through PRs, developers can submit their completed code modifications to the maintainers of the code repository, requesting that these changes be merged into the target branch.
📄️ Creating a Pull Request
Pull Requests are a key collaboration tool used to merge code changes into the main branch of a project. Here are the common steps for creating a Pull Request:
📄️ Pull Request Template
The Pull Request template is a standardized document designed to help developers submit high-quality Pull Requests (PRs). By providing a consistent format, the template enables team members to more efficiently understand and review code changes. Below is a guide for creating and using GitCode Pull Request templates.
📄️ Draft Pull Requests
Draft Pull Requests are Pull Requests that are in an unsubmitted state, which allows you to mark them as drafts when creating a Pull Request. This enables you to work on, edit, and discuss the Pull Request further after creation without immediately triggering automatic merging. This is particularly useful for collaborating with your team when the Pull Request is not yet fully ready or during initial work.
📄️ Fork Workflow
The Fork workflow is a method for collaborating and contributing code, particularly suitable for open-source projects and team collaboration. It allows developers to fork another developer's project into their own account, make changes on the forked copy, and then contribute those changes back to the original project via Pull Requests.
📄️ Lightweight Pull Request
What is a Lightweight Pull Request?
📄️ Code Review
Code review is a collaborative method that allows team members to review, discuss, and provide feedback to ensure the quality, readability, and security of the code. Through code reviews, team members can:
📄️ Resolving Conflicts
A Pull Request conflict occurs when the system cannot automatically determine how to merge code changes during the merging of branches. This typically happens in the following situations:
📄️ Squash Merge
Squash merge is a merging strategy that compresses (squashes) all commits in a Pull Request into a single commit, which is then applied to the target branch. This helps keep the project's commit history clean without becoming cluttered with numerous small commits.
📄️ Version
The Pull Requests version is a snapshot of the different commit statuses in a PR. If changes are needed during the review, you can continue to submit code in your own branch, with each submission creating a new version. This allows you to:
📄️ Cherry Pick
CherryPick is used to select specific commits from one branch and apply them to another branch without merging the entire changes of the branch. This allows you to selectively introduce code changes with great precision, without merging the entire branch.
📄️ Fast-Forward Merge
A fast-forward merge is a method of merging code changes where the changes from the branch being merged are directly applied to the target branch without creating a new merge commit. This type of merge is suitable for the following scenarios:
📄️ Revert
Revert (Rollback) can be used to undo previous merge changes, allowing you to quickly and safely roll back erroneous merges or unwanted changes.
📄️ Pull Request and Issue Association
During the development process, it is often necessary to associate Pull Requests (PRs) with Issues to better track code changes and their underlying requirements or resolved issues.
📄️ Label Management
Labels are important tools for managing Issues and Pull Requests, used to mark specific commits for version control and release management. Labels allow you to quickly categorize, filter, and track issues. This article will introduce how to manage labels in GitCode.
📄️ Milestone Management
A milestone is an important tool used to manage project progress, helping teams set goals and track key stages of the project. During the project development process, a milestone represents a significant goal or phase, typically associated with specific features, version releases, or project deadlines. GitCode provides flexible milestone management functions, making it convenient for users to plan and monitor the progress of the project.