Fundamentals 5 min read

Git Workflow for Collaborative Development: Branching, Rebase, and Merging

This article presents a step‑by‑step guide on using Git in a collaborative development workflow, covering project setup, creation of remote and personal branches, commit cleaning with rebase, merging branches, and final integration into the main branch to maintain a clean history.

360 Tech Engineering
360 Tech Engineering
360 Tech Engineering
Git Workflow for Collaborative Development: Branching, Rebase, and Merging

This guide shares practical experience with Git in a development workflow, aiming to keep commit history tidy, provide clear project traceability, foster good coding habits, and deepen understanding of Git.

Before starting, readers are advised to read the official Git book and an Atlassian tutorial on merging versus rebasing.

The example project consists of a user‑management module and a role‑management module; the role module is completed and development is now focused on the user module.

Development Process

Obtain the project code.

Create a remote collaboration branch named user_admin.

Create a personal development branch from the remote branch, named user_admin_ligang. This personal branch may only be merged back into the remote collaboration branch, not directly into master.

Branch Merge Procedure

Assuming development on user_admin_ligang is finished, the following steps are performed:

Clean up commits : Switch to the personal branch, identify the new base (e.g., init), and use an interactive rebase to drop unwanted temporary commits ( tmp1, tmp2). Edit commit messages as needed.

Merge personal branch into the remote collaboration branch : Ensure only you are operating on the remote branch, update it to the latest state, then merge the cleaned personal branch.

Merge the remote collaboration branch into the main branch : Verify that all development goals are completed, update the local main branch, and perform the merge. Resolve any conflicts and continue the rebase if necessary.

Delete the personal development branch after a successful merge.

Finally, the article shows the resulting commit history after all merges, confirming that temporary commits have been removed and the history is linear and clean.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

workflowGitrebaseCollaborationbranching
360 Tech Engineering
Written by

360 Tech Engineering

Official tech channel of 360, building the most professional technology aggregation platform for the brand.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.