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 checkout -b my-new-branch
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 to git push --force my-new-branch to push these changes to a remote origin
git rebase main
git push --force
Thanks 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!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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!