I had a local branch say, X. It had some conflict. I resolved it and by mistake merged it. I then reverted those commits from main using git reset --soft <commit-hash>
. I deleted the local branch. Now, I have those changes in my local master. I want to push these changes as a new branch. I tried creating a new branch and pushing it. It shows working tree clean. How do I push the local changes in my master as a new branch in remote?
I tried :
git checkout -b <branch>
git push -u origin <branch>
gives working tree clean.
Asked
Active
Viewed 62 times
1

era s'q
- 537
- 1
- 7
- 27
-
@mkrieger1 No. I mentioned above that I tried this it gives working tree clean. – era s'q Oct 27 '21 at 11:26
-
Why does that prevent you from pushing the branch? – mkrieger1 Oct 27 '21 at 11:27
-
@mkrieger1 It says the branch has nothing to commit. – era s'q Oct 27 '21 at 11:30
-
1You still can push it. – mkrieger1 Oct 27 '21 at 11:30
-
Yeah. Even if I do that what will be the changes it will show in PR? Nothing. – era s'q Oct 27 '21 at 11:32
-
Possibly. But you've pushed the branch which was what you were asking. Maybe you meant to ask a different question. – mkrieger1 Oct 27 '21 at 11:33
-
Sorry. It did contain the changes. Thanks. – era s'q Oct 27 '21 at 11:34