git - Overwrite branches while keeping the branch commits -


my team , worked on 6 branches.

yesterday merged branches one.

today did bugfixing.
want continue on our branches.

but before, needs merged code.

we dont want create new branches copy master these 6 branches.

what correct way this?

why wouldn't want create new branches? git branches lightweight, means references pointing commit. creating new branch should matter of starting work reference points same commit master does:

  1. switch master:

    git checkout master

  2. make sure master up-to-date:

    git pull --ff-only

  3. create new branch:

    git checkout -b <new-branch-name>

if instead of creating new branches, still prefer work on same branch before, can make branch point latest master:

  1. switch existing branch:

    git checkout <existing-branch-name>

  2. make current branch point same commit master:

    git merge --ff-only master


Comments