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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:27:23+00:00 2026-06-11T21:27:23+00:00

repost from confused about git branches and master interaction . I still don’t get

  • 0

repost from confused about git branches and master interaction.
I still don’t get it!
I have 1 branch named ‘miscChanges’ in which I have made changes to some pages (I have not yet committed).Now, when I try to checkout the ‘master’ branch I get the message ‘…files would be overwritten by checkout. blah blah’.
I don’t want to commit my changes on the ‘miscChanges’ branch because I’m not done.
What is the logical way to proceed in this case?

  • 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-11T21:27:25+00:00Added an answer on June 11, 2026 at 9:27 pm

    A branch is just a pointer (reference) to an existing commit ID. Changing the current branch means choosing a different pointer.

    This means that uncommitted changes don’t stay on the previous branch, since there’s no place to store these changes. So, when changing branches, git tries to keep these changes in the new code base. To be more specific, any files from the working tree that differ from the last committed state on the old branch will be kept in the working tree after the checkout. But if those files differ between the old and the new branch, git will complain about incompatible changes: it can’t keep the modified file in the working tree since the original file isn’t the same.

    There are three ways to solve this:

    1. Do a temporary commit which you later discard:
      1. git commit -a -m tmp
      2. git checkout master
      3. … do your work on master …
      4. git checkout miscChanges
      5. git reset HEAD~
    2. Do a temporary commit which you later improve:
      1. git commit -a -m tmp
      2. git checkout master
      3. … do your work on master …
      4. git checkout miscChanges
      5. … do more work on the miscChanges branch …
      6. git commit --amend
    3. Use the stash:
      1. git stash save 'work in progress on branch miscChanges'
      2. git checkout master
      3. … do your work on master …
      4. git checkout miscChanges
      5. git stash pop

    If you save more than one stash, you can look up which one should be popped:

    git stash list
    # Find the right stash number, in the form stash@{N}
    git stash pop stash@{3}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have got a crash report for my app from apple it talks about
i am trying to create a report from a row of data with about
I have been tasked with writting a report from MS Dynamic CRM. The report
I have to create new Report from existing report in SQL Server Reporting service,
Normally a great boon to humanity, on occasion vim's indent-based folding will get confused
I'm getting more and more confused as I try to distinguish from the ambiguities
This is a repost from gis.stackexchange . The question is fairly long and detailed
Ok, sorry if this is a repost, I really don't know how to word
One thing I don't understand with sending Async emails from ASP.NET page is when
I'm sure this would have been asked before, but I'm very confused! Say I

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.