Wenn ein anderer Benutzer einen Push zum selben Branch durchgeführt hat wie Du, kann Git deine Änderungen nicht überführen:
$ git push origin main
> To https://HOSTNAME/USERNAME/REPOSITORY.git
> ! [rejected] main -> main (non-fast-forward)
> error: failed to push some refs to 'https://HOSTNAME/USERNAME/REPOSITORY.git'
> To prevent you from losing history, non-fast-forward updates were rejected
> Merge the remote changes (e.g. 'git pull') before pushing again. See the
> 'Note about fast-forwards' section of 'git push --help' for details.
Du kannst dieses Problem beheben, indem du die am Remotebranch vorgenommenen Änderungen abrufst und mit den lokal durchgeführten Änderungen mergst:
$ git fetch origin
# Fetches updates made to an online repository
$ git merge origin YOUR_BRANCH_NAME
# Merges updates made online with your local work
Du kannst auch einfach git pull verwenden, um beide Befehle gleichzeitig auszuführen:
$ git pull origin YOUR_BRANCH_NAME
# Grabs online updates and merges them with your local work

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
