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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:27:40+00:00 2026-06-14T07:27:40+00:00

I am stuck with a weird problem which i dont seem to understand. I

  • 0

I am stuck with a weird problem which i dont seem to understand. I had two local git branches which both pointed to the same remote. Local branches are master and tenant and i have the following config in .git of my ws

[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = git@egitrepo:project.git
[branch "master"]
    remote = origin
    merge = refs/heads/master
[branch "tenant"]
    remote = origin
    merge = refs/heads/master

I did this so i can do git pull easily on both the branches without specifying the remote on the command line.

I am working on the tenant branch while my master branch was not updated and old. I made changes in my tenant branch, did git pull and tried to push the changes to remote.

Doing git push from the tenant branch gave me the fast-forward error.

To git@egitrepo:milkyway.git
    ! [rejected]        master -> master (non-fast-forward)
  error: failed to push some refs to 'git@egitrepo:milkyway.git'

At this point, i looked around and found that this was due to git push trying to push all my local branches to the remote i.e both my tenant and master(non-updated).

I found a solution to this problem by setting

 git config --global push.default upstream

which tells git to push only the current branch to its matching upsteam branch. This solved my problem and my push from tenant branch went successful.

Now comes the problem part, when i looked at the commit history by using git diff to see my commit, i found a number of other files which SHOULD NOT have been a part of the commit. I had added only 8 files for commit and looked at git status very carefully before doing the commit and it showed only the 8 correct files under the changes to be commited section.

How did all those other files went into my commit? Were they added from the master as part of the first failed git push i tried? I say this because these are some of the files i changed in the master branch. Why did git not show them to me in the correct section of git status.Can anybody explain this? Also how can i revert?

  • 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-14T07:27:41+00:00Added an answer on June 14, 2026 at 7:27 am

    You can review the commit history and reflog to determine what happend.

    Use git-reflog and I bet you will see a merge from master to tenant.

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

Sidebar

Related Questions

I am stuck in a weird Design problem, I am working on a two
I'm stuck with a weird problem (which is probably my lack of knowledge), I
I am stuck on a weird problem. I have a CashGameGeneralViewModel class which looks
I encounter really weird problem on which I stuck. I am working on some
I've stuck into some weird problem. Here is the code AccountsController.cs // GET /api/accounts
Just learning Silverlight 4/RIA and i 'm stuck in a weird problem: setup an
I am stuck at a very weird problem. I mean I do not how
I am having a weird problem here, and I am really stuck, need to
I'm stuck at a weird problem regarding imagepng() and similiar. Whatever I do, the
I stuck with problem of mail application , i am developing a website for

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.