Skip to content

Protected branch and commits #22566

Discussion options

You must be logged in to vote

You are right… But instead of stashing he can create a new branch from the local master and push to origin this new branch, then reset the local master to origin/master.  Whit this method no modify were lost and they can review from a PR in github.

In line there are the commands you need to run:

git checkout -B new_branch

this command will create a new branch keeping all the changes made.

Then push this new_branch to origin:

git push origin new_branch

Return to master:

git checkout master

and reset with the origin master with:

git reset --hard HEAD^

This done the trick.

-Gabriele-

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants