Harkonnen
Harkonnen

Reputation: 813

How to change target of remote branch

After splitting my project in 2 branches, I have the following situation :

enter image description here

Remote branch "origin/master" targets my local "departements" branch . I would like this branch to target my local "master" branch instead. How can I do that ?

Thanks in advance for helping.

Upvotes: 0

Views: 626

Answers (2)

René Höhle
René Höhle

Reputation: 27285

If i understand it correctly this is not the concept of git. The concept is to merge the branches.

So can open the branch from your master go to your master:

git checkout master
git branch departments

Then you have a new branch from master and you can work on it.

https://www.atlassian.com/en/git/workflows

Here are some interesting workflows to work with git.

Upvotes: 1

Bartlomiej Lewandowski
Bartlomiej Lewandowski

Reputation: 11170

I would like to point out that both master and origin/master are on a commit with the same description. If you really sure about this you can force push your master so that origin/master will point to the same commit as master.

git checkout master
git push origin master -f

Upvotes: 1

Related Questions