-2

I have the following branches in my local git:

-master
-develop
-test

I am adding a new feature, using the test branch, which was created months ago. I need to update its content (replace everything) with the develop branch.

How can I do that?

Raul
  • 2,373
  • 7
  • 26

2 Answers2

1

Go to develop branch

git checkout develop

Remove the test branch

git branch -d test

Create a new branch called test

git checkout -b test

The new branch test will contain all content of develop branch.

1

In one go, recreate test branch from where dev is, and check it out :

git checkout -B test develop

(doc for the -B option)

Romain Valeri
  • 17,132
  • 3
  • 30
  • 49