I have 2 branches in git repository:
It looks that I have figured out how to do it. For example we have branch
And we need to create new one empty (without history):
git checkout --orphan common
Now we need to add files:
git add .
And commit all:
git commit -m "Initial"
You can see in log only this commit (not all made in myown branch). Now we can checkout myown branch and continue work:
git checkout myown
We can do multiple commits in own branch (similar to regular work):
git commit -m "feature1"
git commit -m "feature2"
Now we have committed both and log contains both. We need to copy that to
common branch and name it "release1"
git checkout common
git merge --squash myown
git commit -m "release1"
That's all for my first part of question.
Also it is easy to commit to
common repository (small change/fix for example related to release1 itself). You can make regular merge to put code back to