Git

Last Updated: 9/20/2023

Pushing

  • We can use the push command to send the new commit to origin. When we run this command, git will send our new commit to the remote repository, then it will move the master pointer forward and finally it would move origin/master as well.
git push origin master
git push origin
git push
  • Sometimes your push may get rejected if histories have evolved differently (other people changes). Git prevents us from overwriting someone else's work,
  • Don't use the force option, it will override other people work
  • We have to do a pull to bring other people's work into our local repository and then we have to do a merge or a rebase. If there are any conflicts, we have to resolve them, and then we can do a push.