Unexpected Error while taking a Snapshot. Id:XXXXXXXXXXXXX. Message: Git push command failed. There was an error running git push

When committing components, you may receive an email with the error below:

"Unexpected Error while taking a Snapshot. Id:XXXXXXXXXXXXX. Message: Git push command failed. There was an error running git push"

This basically means that when you were trying to commit into the branch linked to that Git snapshot, another person pushed to the same branch as you, and Git was not be able to push your changes.

This information is returned by Git in our logs for the commit that returned the error: error: failed to push some refs 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. When this kind of issue happens, you must wait for the other action to finish and commit again. The commit is usually saved in Copado with pending status, which means that it wasn't completed successfully.

From Copado v9, you can see, while doing the commit, if someone else is committing in the same branch. A Copado notification is displayed on the screen.

 

User-added image

 

If you see this warning on the screen, wait for that action to finish before committing to avoid this kind of issues.


How did we do?