Git Up and Git Together

Git Up and Git Together

As the saying goes:

“In case of fire: git commit, git push, and leave the building.”

Funny, but in reality, using Git solo is a very different experience from collaborating on a dev team. Here’s a practical mental model to help you manage version control when working in a shared repository—let’s say one named icecap.

Git Up and Git Together

🧭 Version Control Workflow (for feature development):

  1. git checkout main and git pull
    → Get the latest code from the remote main branch into your local main.
  2. git checkout rev00X
    → Switch to your local feature branch (e.g., rev001, rev002, etc.).
  3. git rebase main
    → Update your local feature branch with the latest changes from local main.
  4. Develop → git commit and git push
    → Save progress locally and sync with the remote feature branch.

Repeat steps 1–4 until your feature is ready for review.

  1. Raise a Pull Request
    → Merge your remote feature branch (rev00X) into the remote main.
  2. Once merged, git pull on local main again
    → Bring your local main up to date with the remote.

Conclusion Key Takeaways

As a developer, you work with:

  • Local branches: your workspace.
  • Remote branches: shared team state.

While you’re developing your feature, the remote main is evolving due to contributions from others. To avoid merge conflicts and stay in sync:

  • Regularly rebase your feature on the latest main.
  • Keep your local and remote branches aligned.

This four-way sync—between local main, local feature, remote main, and remote feature—ensures a smooth, conflict-minimized workflow and clean pull requests.