V
V
Vika Marmeladka2020-12-22 09:36:52
git
Vika Marmeladka, 2020-12-22 09:36:52

How to push a commit to a new local branch from push?

I have a commit with some changes, I soon realized that I can’t push into the master branch (I don’t have rights). The only option is to create a new branch and push to it. But if I create a new branch, the non-pushed commit will be lost. Maybe there is an option to create a branch on the server, but locally, with one command, say that you would push the commit not to the master, but to another branch, without switching to it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2021-01-10
@dlnsk

If you already "have" a commit, it means that it is already in some branch.
Create a new branch and cherry-pick the commit into it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question