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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:37:46+00:00 2026-05-17T01:37:46+00:00

I created a new Branch before I started dev on something experimental. I usually

  • 0

I created a new Branch before I started dev on something experimental. I usually forget that (which isn’t a problem), but now I did it beforehand.
Since then I have updated 3 files.

  • In 2 are only experimental changes that I DON’T want committed to the safe branch.
  • In 1 are only safe (minor) changes that I definitely DO want committed to the safe branch. I’m fine with these last changes to be committed to the new branch as well (but rather not).

Is it possible – I’m sure it is – to (quickly) commit a few unstaged, uncommitted changes from my (dirty) working dir to an old, safe branch?

The only thing I can think of is switching branches (without checkout), commit the changes in 1 file and switch back, but I don’t know what will have happened to the changes when switched back to the dirty branch (are they still there or did they ‘vanish’ due to the commit?)…

I’m sure GIT has something beautiful for this, but GIT has so much, I can’t find the exact same thing.
(I’ve been using this ‘manual’ for help but I’m not sure the same exact thing is in there. If it is (and you’re willing to scan the thing), please let me know, so I know next time to look harder.)

Thanks! For now I’ll just keep a piece of paper handy with changes ‘to commit to safe branch later’.

  • 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-17T01:37:46+00:00Added an answer on May 17, 2026 at 1:37 am

    So your situation is

    x--x--x (safe)
           \
            <a,b,c> (3 private evolutions in exp branch)
    

    And you want to go to

    x--x--x--a (a committed only in safe banch)
           \
            b,c (b and c commited in exp branch)
    

    You could:

    git add a
    git commit -m        # in exp branch, gasp!
    git stash save       # save the rest of the exp work in progress
    git checkout master
    git merge exp        # fast-forward merge
    
    x--x--x--a (safe,exp)
              \
               [b,c] (stashed)
    
    git branch -f exp HEAD~1  # reset branch exp to before 'a'
    git checkout exp
    git stash pop
    git add -A
    git commit -m "..."
    
    x--x--x--a (a committed only in safe banch)
          \
            b,c (b and c commited in exp branch)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a new branch and did svn import of the source files
I have a local branch work, where I created two new files a.py, b.py
my co-worker has just create a new branch in the git repository which we
So there was a new branch created where we made some breaking changes to
I created a new branch in XCode to build a new feature. After some
Recently I have started to implement new experimental feature for my project. Unfortunately I
I have a problem merging from trunk to my branch. I created the branch
I'm having the following problem: I commited two changesets into the default branch, but
So... I have a problem where I created a branch (0.1) and fixed a
I am trying to create a new branch using the API, and have used

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.