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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:08:54+00:00 2026-06-04T02:08:54+00:00

Update : according to the link in my question below, ‘M’ seems to mean

  • 0

Update: according to the link in my question below, ‘M’ seems to mean Merge’d when you see it during a branch change, but Modified with git status: “When we switch to the master branch, the working directory is considered “dirty” since the README file has not been added to the index and committed. As a result, git will attempt to merge the contents of README from the test branch into the README file in the master branch:”

Forgive my git ignorance, but why is it when I make changes in an upstream branch, and then checkout my master branch (without commit’ing), the modified file follows the current branch as a Merge? I thought git only merged when I told it to merge. I don’t always want my edits to propogate to another branch so is there a way to tell git to ask before merging?

iow: How can I tell git to keep me from screwing up another branch if I acccidentally switch to it with un-commit’d edits in my current branch?

[on branch:foo]
$ echo test >> main.c

[on branch:foo]
$ cat main.c 
#include <stdio.h>

int main void (int argc, char **argv)
{
   printf ("Hello world!\n");
   return (0);
}
test

[on branch:foo]
$ git checkout master
M       main.c
Switched to branch 'master'

[on branch:master]
$ cat main.c 
#include <stdio.h>

int main void (int argc, char **argv)
{
   printf ("Hello world!\n");
   return (0);
}
test

[on branch:master]
$   
  • 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-04T02:08:57+00:00Added an answer on June 4, 2026 at 2:08 am

    It depends on what you want to do with the changes.

    If you wanna throw them away use git checkout -f master

    If you wanna save them for later, git stash the changes to clean the working tree and git pop to apply the changes again whenever and wherever you want.

    If you want the changes to stay in the branch, just git commit the changes before git checkout master.

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

Sidebar

Related Questions

Edite: refined the code according to advice in comments but still no luck Update:
I need to update my ListView according to the userinput in SearchDialog . For
I am trying to update a table according to this trigger: CREATE TRIGGER alert
I'm running the following code to update the database according to the data I
(update) ICustomTypeDescriptor works for my Windows Forms app, but not for Silverlight; Not supported.
According to the definition of callback in JQuery pagination plugin's documents. It seems that
According to jro suggestion I am modifying my question and problem I have. ==
I am following this link to build a Client side repeater. According to the
I know how <link type=stylesheet href=.. /> and <script type=text/javascript src=.. /> work. But
I am trying to post a link to an Event's feed but no matter

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.