When I used gitk to check my branches, I found the following:

I created pretty_url, switched to it, worked on stuff, committed, then switched to master branch (which was clean), then ran git merge pretty_url, and checked with gitk, and found this.
I'm sure this is not proper and probably the master wasn't clean. How can I fix this?
That's exactly what you should expect from a merge. If you wanted to rebase and fast-forward, you could have done that instead and had a straight line.
Example:
Before the merge, you had this situation:
That is, the history of
masterandbranchdiverged. They sharehas a common ancenstor. When merging (viagit merge branchwhile on `master), you end up with a commit with two parents to unify that history:If that's not what you wanted, you can undo that and get what you wanted by doing something like:
Which will give you the rebased linear history you seem to be looking for: