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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:32:57+00:00 2026-05-16T04:32:57+00:00

I have a local branch that is tracking of a remote branch on git.

  • 0

I have a local branch that is tracking of a remote branch on git.
At some point I update file ‘x.out’, but while working on this branch I try to pull from the server latest changes. Somebody else already updated ‘x.out’ and git tells me that “cann’t overwrite file” (or so) so I must add my changes to the index and ALSO commit my change before beeing able to pull succesfully.

  1. Issue is that with this approach it results in 2 commits in the repository: one commit for my local change (because I had an older version from server of ‘x.out’ ) and one commit after I “git add” my modified ‘x.out’ file (that basically sais “merge branch ..”)

  2. I don’t want this 2 steps commits (the logs look terrible also) – it’s hard to follow what should have been a single commit. Isn’t there a way like in SVN/Perforce to tell when pulling that I want my local modified file merged with that from server (if automatic merging is possible if not to merge the conflict?) That way when pulling to remote again there is this just only 1 commit and not 2 commits…

  • 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-16T04:32:58+00:00Added an answer on May 16, 2026 at 4:32 am

    You have to pull the changes, and clean the conflicts (if any) locally.

    $ git pull
     ...
    file foobar not up to date, cannot merge.
    $ git stash
    $ git pull
    $ git stash pop
    

    And then remove conflict and add the file.

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

Sidebar

Related Questions

I have a local topic branch that's tracking a remote branch. For the sake
I have a remote tracking branch tracked locally in my local repository using 'git
I have created a local branch X that at some point I pushed to
I have already got a local master branch tracking the remote master branch of
I have a local branch that I created via git branch --track <localFeatureBranch> <remoteSVNBranch>
I have a local branch named ' my_local_branch ', which tracks a remote branch
I have local folder that is branch from formal_versions. My workflow is: Mkae changes
On my local branch, I have some personal (local-only) changes to a Makefile (just
I have a local branch foo that started life as a branch off of
I have a local branch A that's branched from origin/master that I frequently rebase,

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.