Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9196311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:49:23+00:00 2026-06-17T21:49:23+00:00

I’m writing an open source library. I’m using two remotes: one private repo for

  • 0

I’m writing an open source library. I’m using two remotes: one private repo for personal testbed and backup, and another one public hosted on github.

On the private repo, this is where I save and do a lot of commits and pushes with all the little changes like “fixed spelling” or “still working on bug #123!”. This is fine, and I’d like to keep it this way. Private repo will never be shared to anyone.

On the public repo on github, I want my git commit history to be clean. Merging several commits into one commit, e.g. “Fixed bug #123”.

The question is, how do I maintain two separate git history on two different remote repos?

I have been reading articles on git rebase. Would rebase change the entire history of that branch? If I rebase the history for the public repo, does the private repo also get rebased?

Would it be better if I maintain two branches? Is it possible that the public server only see one branch (as master), while the other sees both branches with detailed commits?

I’m not sure what would be the best practices are for this situation. Thank you for your time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T21:49:25+00:00Added an answer on June 17, 2026 at 9:49 pm

    The question is, how do I maintain two separate git history on two different remote repos?

    I wanna beware you, that branch should not be long-living. Long-living branch will become a mess one day because it should be synced with develop branch (or branch where your branch start from) that why you are encouraged to all that git rebase develop and so on.

    Actually, it is hard to understand what is a benefit of having two versions of one branch in different remotes. What is a point of having this branch in your public repo which will contains single commit and have always been force updated? As for me it sounds like unusable nonsense.

    How things is going on in real life:

    • You publish your branch with all commits you have done;

    • When feature is done and everybody is agree with merging this branch into a develop (or where it was created from) branch could be squashed into a single commit or could merged as is.

    • Remote feature branch that you were working in should be deleted since it is merged to another branch and it will be not supplemented with any commits.

    So, there is nothing to maintain at all except the branch that your branch is start from.

    Answering a question literal:

    If you wanna have a branch with single commit with all changes you have done in your current branch, you could do something like that:

    • Get all changes that you have done in current branch. git diff ${SHA}, where ${SHA} is a last commit of a branch that your branch is start from.
    • Redirect this diff to patch file > patch.diff.
    • Checkout to ${SHA} with git checkout ${SHA}.
    • Apply a patch with patch -p1 < patch.diff.
    • Make a commit with git commit -m '...'.
    • Rename branch whatever you want with git branch -m.
    • Push it to remote with git push ${REMOTE_NAME} ${BRANCH_NAME}.
    • Reset this commit before next pushing to public remote with git reset HEAD~1.

    But all this looks bunch of ugly kludges that normal developer would never use :[

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
I am reading a book about Javascript and jQuery and using one of the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am confused How to use looping for Json response Array in another Array.
I am using JSon response to parse title,date content and thumbnail images and place
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.