Git push

On executing the push command, Git will perform the following:

  1. Identify current branch.
  2. Look up the existence of a default remote in the config file (if none is found, it prompts you to provide the remote name or URL as a parameter while executing git push).
  3. Get to know the remote's URL and the heads (branches) tracked.
  4. Check whether the remote has changed since the last time you fetched changes from it.
    • Get the list of references from the remote repositories (using git ls-remote).
    • Check the existence of the entries from the list with the local history. If the reference from the remote is a part of the local repository's history, it's evident that there are no other changes since the last time you fetched/pulled from the remote. So Git will allow you to directly push your changes to the remote. If it's not a part of your local repository's history, Git understands that the remote repository has undergone some changes since the last time you fetched/pulled from it. So it will ask you to first do a git fetch or git pull before pushing.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.128.199.162