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 6037789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:07:31+00:00 2026-05-23T06:07:31+00:00

I have a Git repository whose oldest commit is version 6.8.2 (it is tagged

  • 0

I have a Git repository whose oldest commit is version 6.8.2 (it is tagged “v6.8.2”). I have version 6.8.1 of the package that I would like to commit to the repository as the parent commit of the oldest commit. Is this possible? If so, how?

  • 1 1 Answer
  • 2 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-05-23T06:07:31+00:00Added an answer on May 23, 2026 at 6:07 am

    You could rebase your current branch on top of the oldest commit that you want (v6.8.1). It will rewrite your history, though, but it is possible.

    Edited to add more

    Assuming your code is on the branch master

    Clear out the existing code and create a new branch. Your old code is not lost – it still exists on the master branch.

    git symbolic-ref HEAD refs/heads/newbase
    rm .git/index
    git clean -dxf
    

    Now you are on the branch newbase which is an empty directory. Add the files that you want to be the new base to here.

    <add the files to the directory>
    git add .
    git commit -a -m "New base commit v6.8.1"
    

    New you have two branches master which has your original code and newbase which has only your new base.

    Now checkout the master branch and rebase it upon the newbase branch

    git checkout master
    git rebase newbase
    

    And then All you need to do is fix the conflicts, and you have a new master branch that starts at the earlier state of the code.

    This is all a bit of a mess though. If you just want to add the code to the repository, just do the first bit, which creates a new branch. Tag it so that you know what it is, there is no need to rebase the master branch on to it because if you get to the base of master, and want to go further back in time – you can just see what is in the other branch.

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

Sidebar

Related Questions

Suppose I have Git repository like this: git-repo/ directory_1/ directory_2/ directory_3/ This has a
I have a repository whose layout is like this: trunk/ projectA projectB branches/ projectA-1.0
I have a central git repository that everyone pushes to for testing and integration,
I have a git repository that I am using and I've screwed up. I
I have a repository that is currently using Subversion, but I'd like to use
We have a git repository which contains source for a few related Java WARs
I have a git repository (at github.com) with two branches: master and gh-pages. I
I have a git repository with submodules in the directory projects/myRepo and I want
I have a Git repository which I have started to develop on master branch
I have setup a git repository in a linux server, and installed the latest

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.