Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Git: failed-to-push-some-refs #76

Description

@ianmiell

NOTES:

====== 'Failed to push some refs to' errors ======

===== Overview =====

===== Check RunBook Match =====

If your error looks similar to this, then this is a match:

''$ git push\
To ssh://meirionconsulting.com:/var/cache/git/work.git\
! [rejected] master -> master (fetch first)\
error: failed to push some refs to 'ssh://imiell@meirionconsulting.com:/var/cache/git/work.git'\
hint: Updates were rejected because the remote contains work that you do\
hint: not have locally. This is usually caused by another repository pushing\
hint: to the same ref. You may want to first integrate the remote changes\
hint: (e.g., 'git pull ...') before pushing again.\
hint: See the 'Note about fast-forwards' in 'git push --help' for details.''

===== Initial Steps Overview =====

  • [[failed-to-push-some-refs#gather_facts|Gather facts]]
  • [[failed-to-push-some-refs#examine_differences|Examine differences]]
  • [[failed-to-push-some-refs#decide_on_resolution|Decide on resolution]]

===== Detailed Steps =====

==== 1) Gather facts ====

Examine the output of your error above and extract the key points of information:

Note down the repository mentioned in the ''To '' line in the output as the 'remote repository'.

Note down the two names either side of the ''->'' in the line that begins ''! [rejected]'' as 'fromref' and 'toref' respectively.

Run:

''git remote -v | grep fetch''

from within your repository. Find the line that matches your 'remote repository' and note the first word on the line as the 'remote repository reference'.

==== 2) Examine differences ====

Make sure you have your remote branch 'fetched' locally ready for comparison.

TODO

==== 3) Decide on resolution ====

TODO

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions