T
T
Troodi Larson2019-09-24 17:09:13
git
Troodi Larson, 2019-09-24 17:09:13

How to push uncommitted changes to another branch?

How to push uncommitted changes to another branch? Sometimes it happens that I need to merge on my computer, and I forget to change the master to a branch before changing the files. And you can’t change to a branch because the changes are not committed. And you can’t get it either, because the changes are not committed. So what can help in this case? I suspect that in the description of the problem, I made inaccuracies, but I'm still getting acquainted with the git.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
IgorNoskov, 2019-09-24
@troodi

Without making a commit, go to the desired branch, the changes will not go anywhere, commit them in the desired branch.
Update
This applies to the case where two branches are on the same commit. If they are separated from each other, then you can stash the changes, go to the desired branch and apply the stash, and then commit.
Update2
Watch the video https://learn.javascript.ru/screencast/git#branche... where everything is described in detail about this situation. I advise you to watch all the videos from this screencast.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question