I want to move it to another branch including initial commit.

Asked 1 years ago, Updated 1 years ago, 90 views

There is a newly created empty repository on GitHub.
Originally, we were supposed to clone the repository, commit it to the master branch, branch it to the topic branch, work on it, and eventually send PR to the master.
However, I realized that I was doing all the work on the master now.
What I want to do is to transfer all commits on the master branch to another branch, and then the branch to which I want to transfer to branches off from the master.
Is it possible?
Also, please let me know if there is any other way to send PR to the master from this situation.

git github

2022-09-30 21:11

1 Answers

Let's rename it.

git branch-m master develop #Rename local master to develop
git push origin:master#remote master branch removed
git push --set-upstream origin develop #push to remote as develop

Or why don't we just make brunch?

 git branch develop master
git checkout develop
git push origin develop


2022-09-30 21:11

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.