Joshua Bakker
Joshua Bakker

Reputation: 2348

Create a new branch and discard local commits on the other

Currently there are 2 remote branches: master and development. How we work (and how most people work) is that you create a branch for a feature.

Now, I did everything in development. I just created a new branch for my feature which - and this makes sense - is up to date with my local branch (because I created it from my local development branch).

Is it possible to discard the commits in branch development but still keep them in my newly created branch?

Upvotes: 0

Views: 34

Answers (1)

Vampire
Vampire

Reputation: 38619

Sure, just do git branch -f development origin/development to repoint the local development branch to the remote development branch.

Upvotes: 1

Related Questions