I am currently on a debug branch, and would like to switch to the master branch, without modifying the working tree (leave it the way it is in the debug branch), so I can co
As far as I know, you can't. Branch switching means checking out into the working copy a version of the code that sits in the HEAD of that branch.
You want to merge your branches. Do
git checkout master
git merge devel
The branches will now be synchronized. If you want to merge a subset of changes, you can specify a commit or a range of commits. Also take a look at cherry-pick For example:
git checkout master
git cherry-pick devel
Will merge the last commit in devel back into master.
If you need to merge two branches that sit on different hosts, have a look at git pull and git push.