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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:33:47+00:00 2026-06-17T17:33:47+00:00

I’m having troubles phrasing this clearly, but I’ll give it a shot. Situation: I

  • 0

I’m having troubles phrasing this clearly, but I’ll give it a shot.

Situation:

  • I forked a Repository as my master then cloned it locally.
  • Made my changes, and sent a pull request.
  • The pull request has been closed, and has been “added manually”
    (patch and apply).

Question:

  • How do I get my local (and remote) repository back in sync with the upstream project?

  • I don’t care about keeping minor differences.
  • I want my code to be easily pulled in the future.
  • I don’t want to lose history (mine or upstreams).
  • Will the solution cause me issues with developing in the future?

Alternatives:

  • is there an easier way?
  • Should I just rename this branch (somehow) and start afresh?
    • (somehow) sync the rename locally and work from a new master?
    • Should I now forget using branches named master as this will cause me issues?

Github’s in question:

  • Original Upstream “pull”
  • My Repository
  • 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-17T17:33:49+00:00Added an answer on June 17, 2026 at 5:33 pm

    Well, the easiest thing if you don’t want to lose your history is to always create a feature branch where you work on your pull request.

    In your case (if you want to keep your history), create a new branch

    git checkout master
    git checkout -b my-old-feature
    

    Then, just reset your master branch to whatever point is the upstream master branch

    git remote add upstream <upstream-repo-uri>
    git fetch upstream
    git checkout master
    git reset --hard upstream/master
    

    There you then have a clean state and your master branch will be exactly the upstream one. In the future, just always keep master branch following the upstream/master one, and work on feature branch you create to prevent collision with upstream updates.

    edit:
    By the way, I always prefer to have my branches named the same as the upstream. But you can also track upstream/master on another branch name. For example:

    git pull upstream master:upstream-master
    

    Hope this help!

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
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.