Earlier quoted context omitted.
Let's compare git to SVN. With SVN your only real option is to commit something that is working, right? If you commit something broken to SVN then you will likely get yelled at. With git, you can make a few changes, then think "hmm that might not be the best way to fix it" do a commit and then rip out everything you just did and do it a different way. Or maybe you Added some instrumentation for debugging the problem,…
Does using rebase or squash leave the history in my local repo and "squash" the commits to a single one in the master? Sorry for basic questions but I'm new to git.
Say you are working on a feature in a branch and have made several commits. Now it's time to clean them up in preparation for a merge. You can either squash the entire branch into one revision into master and create a new commit message (git merge --squash) or you can rebase.
If you rebase, you can use interactive mode (git rebase -i) and rewrite your local history however you see fit. You can reorder commits, remove commits, merge commits, edit commits, edit commit messages, anything. It's extremely powerful and lets you make the history of your current branch into whatever you want it to be. I use rebase -i quite a bit to merge "typo" commits into the original commit. Used sparingly rebasing really helps to keep your timeline clean.
You can also rebase while in master but you should not go older than the newest shared commit (origin's HEAD) nor should you edit other people's code during a rebase.