To create a new branch and switch to it at the same time, you can run the git checkout command with the -b switch:
git checkout -b issue53
Shorthand for:
$ git branch iss53
$ git checkout iss53
normal commit after changes
git commit -a -m 'added a new footer [issue 53]'
OH NO WE NEED TO WORK ON MASTER NOW EVERYTHING IS BORKED AND ISSUE 53 IS WAY LESS IMPORTAINT
commit then switch back to master!
git commit -a -m 'Gotta make sure everything is commited to the branch or git will get mad!'
git checkout master
since we're super fancy we're gonna make ANOTHER branch!
git checkout -b hotfix
nano thefilewiththeissue.co.uk
git commit -a -m 'fixed the broken thingy'
now that its fixed we merge that into master
first we go back to master branch
git checkout master
now we merge it!
git merge hotfix
the branch can now be deleted
git branch -d hotfix
and switch back to the original one, finishing it up
git checkout iss53
nano meowmeow.nya
git commit -a -m 'finished the new footer [issue 53]'
back to master to merge
git checkout master
git merge iss53
IF THERE IS A CONFLICT
git status
to see what conflicts are!
then u gotta fix doez conflicts dis is easy if you have an IDE
and then
git add .
or whatevea
upon which you shall run the command "git commit -m "WE DID IT"
" as you complete this lil tutorial.