Git push remote rejected {change ### closed}

i am having problems pushing my changes from my local master to remote master because of this error:

remote: Processing changes: refs: 1, done
To ssh://
 ! [remote rejected] HEAD -> refs/for/master (change 14823 closed)
error: failed to push some refs to 'ssh://'

any idea how i can fix this issue?

  • How to create custom namespace under gerrit?
  • Gerrit - annotate patch-sets
  • What to do, when missed some key refs during push to Gerrit
  • Gerrit as a review tool, not as the repository of record
  • git rebase to remove a commit
  • How to post votes on custom labels from jenkins gerrit trigger?
  • git status says my branch is ahead of origin/master by 5 commits.

  • git commit with emacs as editor under Windows
  • Reject commit in Git if Java code style isn't correct
  • How to handle a Git discontinuity?
  • git commit best practices
  • Dealing with files that Git refuses to reset?
  • Some NGit stuff prevents C# application from shutting down correctly
  • 15 Solutions collect form web for “Git push remote rejected {change ### closed}”

    I got the same message. And it was because I have managed to get the same Change-Id for two commits. Maybe due to some cherry-picking or similar between my local branches. Solved by removing the Change-Id from the commit message, a new Id then was added by the commit hook.

    I found the following page which details exactly why you’re unable to push your changes to the origin due to the change XXXXX closed error:


    You have 5 commits.

    All of them has a file called “Commit Message” (used by Gerrit).
    One of these files has a bad “Change-Id” that was already accepted
    and merged into master by Gerrit, and hence cannot be used again.

    One fix is to merge all 5 commits into one,
    and in the process of doing that,
    delete the “Change-Id” in file “Commit Message”.

    In my case, I had 3 commits, so I did:
    git rebase -i HEAD~3

    There are other ways of merging multiple commits:
    Squash my last X commits together using Git

    Your Commit Change ID is expired ie, Review 14823 is closed. you can’t push to same.

    Do this to fix issue:

    1. git commit --amend
    2. delete change id
    3. save and quit
    4. new change id will be added to the commit. it can be verified by git log.
    5. push again

    The change 14823 closed message does not come from vanilla git. It indicates that whoever maintains that repository has an update or post-update hook that is evaluating your push and rejecting it due to local policy (I’m guessing you’re adding additional commits to an issue that has already been marked as completed/closed). You’ll need to find out what those policies are, and whether you need to somehow get the change re-opened so you can add commits to it, or if you need to create a new change request and (probably) rebase your work against it.

    git status says my branch is ahead of origin/master by 5 commits.

    all im doing is fetching latest code. doing some tweaks and pushing it.

    What are those 5 commits? Are they all yours?

    Does change 14823 correspond to one of those 5 commits? What’s its status in Gerrit?

    You’re pushing to gerrit, which is a code review tool, as indicated by both the url (ssh:// and the “HEAD -> refs/for/master” message. You need to consult with whoever maintains the repository you’re trying to push to in order to figure out why the change is being rejected.

    Try this.
    git push –no-thin origin xxxxxx:refs/for/sprint/yyyyyy

    I and my senior work more than 1 hour to get solution,
    So I tried below, It works for me

    1. Backup all branches from .git/logs/refs/heads/{{branch}} folder and updated files in repo
    2. Removed Branches which cause error
    3. Create Branch “git branch ‘{{new branch name}}'”
    4. move back repo files to relevant folder
    5. git commit -m “{{commit message}}”
    6. git push origin HEAD:refs/for/master

    Every thing should be fine and done nicely

    in my case I had 2 commits, the first commit was mine but second one wasn’t, so I fix it this way:

    1. find out which files were committed in change 14823
    2. find your oldest commit and do a soft reset to its parent. be aware, if you do a hard reset you may lose all your commits.
    3. try to commit your changes one more time but in this time without the files from change 14823

    I hope it’s helpful.

    I encounter this problem too, when I push my commit and the terminal says:

    ! [remote rejected] HEAD -> refs/for/android_ui.lnx.1.2.c1-dev (change 1692698 closed)

    I go to review site to see the change corresponding 1692698, the commit message is:
    “Prompt USB tethering help when first time enable WiFi hostpot”

    Then show the commit logs in terminal:

    • b49c0f91744cb6f863616976c4fb4157c7af4b8c The prompt is not correct when enable USB tethering with Wi-Fi connected.
    • eb47ef919064aff516ced4bbd9d8ade0ed34b107 Prompt USB tethering help when first time enable WiFi hostpot
    • 753668be1207baa514be1bbd985f3db2d6317608 Fix hotstop Notification bug.

    The reason why push fail is that the current changID is the same with that of eb47ef919064aff516ced4bbd9d8ade0ed34b107 commit. so I backup current change and reset hard to 753668be1207baa514be1bbd985f3db2d6317608 and then apply the backup change, add, commit and push successively finally.

    Hope this can solve your problem.

    This can happen if there already exists a change on gerrit that either has been merged or even abandoned. If abandoned, which was my case, restore that change on gerrit and apply the new change on top of the restored change.

    You have 5 commits.

    Each commit has a “Commit Message” that may contain a “Change-Id:” string that identifies which Change Request that commit belongs to for Gerrit (see

    In this case one (or more) of the Change Requests identified by the Change-Id strings is already merged or abandoned by Gerrit, and hence cannot be used again.

    You need to modify the commit message for one (or more) of the commits before pushing them (see, either removing them to create new Change Requests, or modifying them so that they identify the correct Gerrit Change Requests for each commit.

    Solution for EGit users:

    1. Click Amend button
      enter image description here

    1. Delete Change-Id from commit message area using backspace button (this will be something different from this screenshot)
    2. Click ‘Add Change Id’ buttonenter image description here

    3. Commit your changes & push.

    This should do it:

    git commit --amend

    Delete the change id and then push for review.

    Git Baby is a git and github fan, let's start git clone.