There is this rule to not to rebase commits that were pushed to remote repository. As long as I understand general reasons for that, it's not clear for me, does it apply also to such scenario:
Lets say that I work on some feature, which development will take several days. So, I create branch MyFeature, checkout to it, and commit some stuff. Since work takes several days, I don't want to keep it in my local machine, so for the backup’s sake, I push this branch to remote.
After finishing work, I want to merge it somehow to the master.
My questions:
- On the assumption that no one else will never checkout and pull MyFeature branch, and base his work on commits from this branch (why someone would like to pull some random branch?), is it ok to rebase such remote branch? (using –force switch)
- If it is still not advisable for some reason (I would like to learn that reason, though) what is the alternative? Simple merge? But if so, afterwards, I still would like remove MyFeature branch from, both local and remote repositories. So how it would be different from (1)? I still change history by removing it completely.
- Is above mentioned scenario rare or untypical? I mean, while searching answer for this, reading tutorials and SO questions about git-rebase, there is always stressed this peril of rebasing remote branches, but there are never considered other use cases like that. IMHO it's pretty common to work on some feature longer that day, and I think no cautious developer shouldn't keep changes only on his computer...