Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git how to transfer changes between branches?

Tags:

git

github

If I have added something in master branch then I decided that it need to be in a purposely created branch, called some-branch.

Those new files changed in master are now green. I do not want to commit them in master but in the new branch that I have forgot to create befor I have made the changes.

So how to commit changes for a different branch?

like image 406
Raz Buchnik Avatar asked May 20 '26 08:05

Raz Buchnik


1 Answers

As long as the branch doesn't have conflicting changes, you can git checkout your new branch with those changes (without committing) and they will remain.

like image 171
SLaks Avatar answered May 22 '26 23:05

SLaks