danielhpavey.uk

Git Branch Notes

Simple list of git branch commands for reference:

  • List current branches:

    $ git branch

  • Create a new branch:

    $ git branch branchname where branchname is name of your choosing

  • To switch to your new branch:

    $ git checkout branchname

  • To merge branches back, switch to the master branch then:

    $ git merge branchname

  • Or to delete the branch:

    $ git branch -d branchname

Date: Tuesday 29th January 2013