I use my git repository in two different computers.
I had to run some tests on the Desktop so I created branch X, then I did some work on the master branch and had to rebase X and squash some commits to create patches then I force-pushed the changes to the remote repo.
Afterwards I cloned the repo to my laptop and did some changes but now when I try to push it complaints about fast-forwards and that I have to make a git-pull(which I dont want to do since I have rebased and squashed/edited commits again)
All I want is to have a clone of the repo as I on my laptop on the origin repository
So the question is: Is force-push my only option?
If you want your branch on the remote machine to be exactly like on your laptop and discard whatever differences there are:
git push -fdoes exactly that. It pushes your local branch’s state to the remote repo and forcibly sets the remote branch to the tip of what you just pushed. Any commits the remote branch contained that aren’t referenced in your local branch or elsewhere will be unreachable.