I know git badly (very badly), so sorry for the dumb question.

Now I’m on the master branch as amended. I understand that I will not be able to fix this problem right now, so I want to transfer them to another branch, which I will now create and hide from prying eyes.

I.e:

git checkout -b new_branch 

Now I'm on the new_branch branch. How to make changes visible only in the new_branch branch?

    2 answers 2

    Now you just need to commit (save) the changes.

     git add . git commit -am "Some commit description" 

    then you can switch back to master

     git checkout master 

    To study git, read this book: Git Book . It is small and written in accessible language.

    If some moments are not clear, then the main thing is not to stumble and read further, and you can return to the missed material later.

    • Thank you :) I will read the book in order not to ask stupid questions anymore. - Vitaly Yuriev
    • The question is not stupid, everyone once started;) - AlexDenisov

    If the changes have not yet hit any commit, just make

     git add . git commit -m 'недоделанные изменения' 

    in branch new_branch

    If a commit with changes already exists in both branches, you need to roll it back in the wizard, for example:

     git reset --hard master^ 
    • 2
      Do not show reset :) to newbies - AlexDenisov