Why has git change behavior changed relative to working copy changes?

I want to make changes to my working copy, but git won't let me, I get the same error as this question :

Cannot rebase: Your index contains uncommitted changes.
Please commit or stash them.

      

I know I can commit and then merge or stitch and then pull and then apply the wallet, but the pull earlier will merge the changes into my working copy, keeping my local changes. It was easy, any conflicts would be noted for me in my working copy, like merging committed changes. I found this very handy, why did this behavior change? And how can I get git to behave the same way?

+3


source to share


2 answers


You seem to have configured git to always do git pull --rebase

. There are several configurations that lead to this behavior. I'll quote from the documentation :

See pull.rebase

, branch.<name>.rebase

and branch.autosetuprebase

in git-config if you want git pull to always use - -rebase instead of merge.

If you want git to merge your changes, rather than overload them when you pull, you need to find the culprit config and disable it.



If the configuration has pull.rebase

been enabled globally, for example, you can disable it with the following command:

git config  --global --unset pull.rebase

      

+2


source


Unable to reinstall

This means that you are not just pulling. you do pull --rebase

.
(Or, as Zeeker mentions in the comments , you have git to always do pull --rebase

, for example via git config pull.rebase true

)

And if you want to automatically hide (and reapply) your work, you can check if this works with (Git 2.0.1+, July 2014) a:



git config rebase.autostash true

      

More details with Git - How to edit an old (non-previous) commit with some unsettled changes from the current index (current state)? "

+2


source







All Articles