Skip to content

Instantly share code, notes, and snippets.

@atima
atima / work-with-public-private-repos.md
Created August 26, 2025 22:50
Procedure to privately develop a feature branch of a public repository

Working with Public and Private Git Repositories

Sometimes you need to work with a public repository but want to develop a new feature privately. This guide shows how to create a branch from a public repo, push it to a private repo for development, and then move it back to the public repo when ready.

Step-by-Step Guide

1. Clone the Public Repository

git clone https://github.com/user/public-repo.git
cd public-repo
@atima
atima / procedure-to-move-commits.md
Last active July 12, 2025 04:15
Procedure to move only specific commits to a branch while maintaining linear history.

Moving and Realigning Commits

Sometimes you need to transfer specific changes from a feature branch (e.g., dev) to a stable branch (e.g., main) without bringing over all subsequent development. This often involves:

  • Cherry-picking selected commits from dev onto main.
  • Rebasing dev to "fast-forward" its base to the newly updated main branch, making dev appear to branch from a later point.

This method results in a clean, linear history on main, making it easier to track specific feature integrations.

Important Note: This workflow rewrites the history of the dev branch. If dev is a shared branch that other team members are actively working on, performing a rebase will cause significant headaches and potential data loss for them. Only use this strategy on private or unshared branches.

@atima
atima / procedure-to-archive-git-branches.md
Created February 18, 2025 22:00 — forked from zkiraly/procedure-to-archive-git-branches.md
Procedure to archive git branches.