I have a local repository with a toy project that has turned out to be more serious than I had thought. So from a single development branch where I have carelessly committed, I have started to use branches kind of like in the famous http://nvie.com/posts/a-successful-git-branching-model/
I would now like to have a "central" remote repository that I can push my develop and master tree.
The first issue is: how do I do this. Do I initialize an empty repository on my server and reference to this repository as the remote origin in my local repository?
Do I have to create the branches in the remote repository beforehand or is it enough just to push them?
Secondly the first commits in my local repository are really awkward, so I would like to cumulate a lot of those early commits into one, either in the way of --no-ff or as I understand to squash them.
As I understand, this is only working with an intermediate branch. i.e. right now I have 2 branches "develop" and "master" in my local repository. I came up with two ideas how to "change history"
I create two branches develop-squashed and master-squashed. Rebase my original branches to those while squashing commits I want to loose. Upon having -squashed branches being equivalent with the original master and develop branches, I can delete the original ones and "rename" the *-squashed branches to master and develop.
Finally I can push master and develop into the remote repository.
Is that the way to go?
How can I make sure that by rebasing, both branches master and develop both have the same history up to the point when I started to follow the "successful git branching model"? (They have the same history up to that point at the moment).