DEV Community

Discussion on: Master Git in 7 minutes

Collapse
 
emptypockets profile image
Andrey Kondratyuk • Edited

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?

Thread Thread
 
valeriavg profile image
Valeria

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

Thread Thread
 
emptypockets profile image
Andrey Kondratyuk

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!