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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:34:41+00:00 2026-05-22T16:34:41+00:00

What I want to do: Pull from my remote repository on github. Preserve all

  • 0

What I want to do:

  1. Pull from my remote repository on github.
  2. Preserve all the files in my local repository and discard the ones from github.
  3. Push my “up to date” local repository into github.

So imagine you’ve made a lot of changes in your local repository and is now very different from your github repository.

I could do:

  1. git pull origin master: to get the remote repository
  2. git mergetool: to resolve all the conflicts one by one.

But is there any way to resolve all the conflicts automatically?

That is, tell git that you simply want to preserve the files version from your local repository and discard the ones from the remote 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-05-22T16:34:42+00:00Added an answer on May 22, 2026 at 4:34 pm

    You could pull with the ours merge strategy

    git pull --strategy=ours origin master
    

    From kernel.org

    This resolves any number of heads, but
    the resulting tree of the merge is
    always that of the current branch
    head, effectively ignoring all changes
    from all other branches.

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

Sidebar

Related Questions

I want to pull data from a remote db into an sqlite database I
I have a remote monotone repos I want to pull from, but I really
I've forked a Mercurial repository, and now I want to pull the changes from
Is it even possible? Basically, there's a remote repository from which I pull using
I have a multidocument application. I want to pull data from each of those
I want to pull a series of relationships out of xml files and transform
I want to pull in data using a XML::XPath parser from a XML DB
I am used to pull from a git repository of someone. Today he moved
Possible Duplicate: Using Git how do I find modified files between local and remote
So I'm working with another developer and want to pull and push to a

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.