Branches

From http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html

checkout a tag and create a local branch from it
git checkout -b 

e.g.

git checkout R180 -b local_R180

show local branches
git branch

master
 * local_R180

switch to a specific branch
git checkout master Switched to branch 'master'

git branch local_R180
 * master

git checkout local_R180 Switched to branch 'local_R180'

git branch master
 * local_R180

edit a file on the local_R180 branch, commit and switch back to master
vim MIPSSMP86XX_WEGENER_LINUX.sh git commit -a git checkout master Switched to branch 'master'

Try to merge local_R180 into master
git merge local_R180

check what happened
git status

it should show something like this:

src/ic_NativeImpl/NativeImpl_Fnt/NativeImpl_Fnt_md_AMINO_LINUX/SDL_ttf.c: needs merge src/ic_NativeImpl/NativeImpl_Fnt/NativeImpl_Fnt_md_AMINO_SDK_110_LINUX/SDL_ttf.c: needs merge src/ic_NativeImpl/NativeImpl_Fnt/NativeImpl_Fnt_md_MIPSSMP86XX_WEGENER_LINUX/SDL_ttf.c: needs merge src/ic_NativeImpl/NativeImpl_Fnt/NativeImpl_Fnt_md_PPCSTB02500_LINUX/SDL_ttf.c: needs merge src/ic_filePlayer/ic_filePlayer.c: needs merge src/ic_filePlayer/ic_filePlayer_md.h: needs merge src/ic_streamCli/ic_streamCli_md_MIPSSMP86XX_WEGENER_LINUX.c: needs merge
 * 1) On branch master
 * 2) Changes to be committed:
 * 3)   (use "git reset HEAD ..." to unstage)
 * 4)       modified:   MIPSSMP86XX_WEGENER_LINUX.sh
 * 5)       modified:   include/NativeImpl_Player.h
 * 6)       modified:   include/ic_drv.h
 * 7)       modified:   include/ic_filePlayer.h
 * 8)       modified:   src/ic_common_ver/ic_common_ver.c
 * 9) Changed but not updated:
 * 10)   (use "git add ..." to update what will be committed)
 * 11)   (use "git checkout -- ..." to discard changes in working directory)
 * 12)       unmerged:   src/ic_NativeImpl/NativeImpl_Fnt/NativeImpl_Fnt_md_AMINO_LINUX/SDL_ttf.c
 * 13)       unmerged:   src/ic_NativeImpl/NativeImpl_Fnt/NativeImpl_Fnt_md_AMINO_SDK_110_LINUX/SDL_ttf.c
 * 14)       unmerged:   src/ic_NativeImpl/NativeImpl_Fnt/NativeImpl_Fnt_md_MIPSSMP86XX_WEGENER_LINUX/SDL_ttf.c
 * 15)       unmerged:   src/ic_NativeImpl/NativeImpl_Fnt/NativeImpl_Fnt_md_PPCSTB02500_LINUX/SDL_ttf.c
 * 16)       unmerged:   src/ic_filePlayer/ic_filePlayer.c
 * 17)       unmerged:   src/ic_filePlayer/ic_filePlayer_md.h
 * 18)       unmerged:   src/ic_streamCli/ic_streamCli_md_MIPSSMP86XX_WEGENER_LINUX.c
 * 1)       unmerged:   src/ic_filePlayer/ic_filePlayer.c
 * 2)       unmerged:   src/ic_filePlayer/ic_filePlayer_md.h
 * 3)       unmerged:   src/ic_streamCli/ic_streamCli_md_MIPSSMP86XX_WEGENER_LINUX.c

merge conflicts
git diff

nice graphical representation of the resulting history.

gitk

At this point you could delete the experimental branch with

git branch -d experimental

This command ensures that the changes in the experimental branch are already in the current branch.

If you develop on a branch crazy-idea, then regret it, you can always delete the branch with

git branch -D crazy-idea

Branches are cheap and easy, so this is a good way to try something out.

create branch
git branch

switch to branch
git checkout

check on which branch you are
git branch