No, the steps would be the same, but force push would wipe remote branch commits that have not been pulled and may require hard reset on all local repositories, apart from your own.
Yes you can rebase my-new-branch from main with git rebase main locally, but you will need to git push --forcemy-new-branch to push these changes to a remote origin
Does it matter if branch changes are pushed to a remote before rebasing? Would the steps be any different?
No, the steps would be the same, but force push would wipe remote branch commits that have not been pulled and may require hard reset on all local repositories, apart from your own.
I don't think I 100% follow.
If I created a branch
git checkout -b my-new-branch
and then stage, commit, and push:git add .
git commit -m "my message"
git push origin my-new-branch
Does it matter that it the code was pushed to the remote? Could I then rebase as you described?
Yes you can rebase my-new-branch from main with
git rebase main
locally, but you will need togit push --force
my-new-branch to push these changes to a remote originThanks for the clarification. I think I understand. My plan at the moment is to try it with different scenarios and make sure I really do get it.
Great guide. Very much appreciated!