stack
stack

Reputation: 45

How to override single remote branch?

I have 2 remote branches, branch1 & branch2.

I created branch3 locally by cloning branch2, and I want my branch3 to be pushed with the overridden version of branch2 as a new separate, independent branch.

The problem is that when I push my local branch3 to the remote, branch3 still contains the files from the branch2, which I deleted in the new branch3..

Is there any better way to fix this branch issue?

Upvotes: 0

Views: 45

Answers (1)

SwissCodeMen
SwissCodeMen

Reputation: 4875

You must stop the tracking to the remote branch from the local branch branch3, then the remote branch is branch2, because branch3 was cloned from there:

$ git branch3 --unset-upstream

After this, push the local branch (branch3) new to remote, as a new independent remote branch:

$ git push -u origin branch3

Upvotes: 1

Related Questions