Skip to content

The repository has been updated since you last pulled. Try pulling before pushing. #2738

Closed

Description

@adamreisnz

If this error shows up, would it be possible to change the button "Push origin" to "Pull origin"?

image

Now I'm left with only the push option, which doesn't work, so I have to hunt in the menu to find a pull command or use command line.

Actually, now after about 40 seconds, it changed to "Pull origin" by itself. Guess there might be something wrong with the update of it.

Activity

  1. added
    bug
    on Sep 15, 2017
  2. joshaber commented on Sep 15, 2017

    @joshaber
    Contributor

    Agreed, changing the button to be a great improvement 👍

  3. added and removed
    bug
    on Sep 15, 2017
  4. shiftkey commented on Sep 18, 2017

    @shiftkey
    Member

    Actually, now after about 40 seconds, it changed to "Pull origin" by itself. Guess there might be something wrong with the update of it.

    Sounds like we were waiting on a fetch to happen to update the button state.

  5. shiftkey commented on Sep 18, 2017

    @shiftkey
    Member

    @adamreisnz looking into the work we did around this in #2445 - we should be doing a fetch behind the scenes as per 7ab75c9. So a couple of questions from your logs:

    • do you see the fetch happen in the log after the push error?
    • how long does a typical fetch take with this repository?

    Normally the fetch would update this button, but maybe we've missed something with this workflow that's different to our background fetch?

  6. adamreisnz commented on Sep 18, 2017

    @adamreisnz
    Author

    @shiftkey I don't recall what machine I did it on anymore so not sure if I can dig up the logs, but a fetch usually doesn't take more than 1-2 seconds for that repo.

  7. shiftkey commented on Sep 18, 2017

    @shiftkey
    Member

    @adamreisnz no problem - it should be easy to reproduce, just a bit time-consuming...

  8. CruiseMan commented on Mar 30, 2018

    @CruiseMan

    @joshaber Do you know ETA for this one ?

  9. solocatz commented on Aug 27, 2018

    @solocatz

    It happens again, is there a solution?
    2018-08-27 14 38 15

  10. newdawnguitar commented on Aug 28, 2018

    @newdawnguitar

    @copycatx5 I clicked 'undo' underneath the commit button. Then the push button changed to fetched. So i fetched. Commited again. Then pushed.

  11. MaximePie commented on Aug 30, 2018

    @MaximePie

    Clicking 'Undo', fetching, pulling, and commit again worked for me, thanks @newdawnguitar !

  12. acerock6 commented on Sep 7, 2018

    @acerock6

    You can go to Repository -> Pull and then click on Push Origin.

  13. indysigner commented on Oct 23, 2018

    @indysigner

    On year in, this problem still hasn't been fixed 🙄

  14. tierninho commented on Oct 23, 2018

    @tierninho
    Contributor

    Dropping in to add some clarity to the reproduction steps and paste my logs.

    • Commit some stuff to a repo on Desktop
    • go to the same repo on Github.com and add a new file
    • click Push origin on Desktop

    Logs:

    install.ts:23 git -c credential.helper= push origin master:master --progress exited with an unexpected code: 1.
    To https://github.com/tierninho/AAAAAAAA.git
     ! [rejected]        master -> master (fetch first)
    error: failed to push some refs to 'https://github.com/tierninho/AAAAAAAA.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.
    
    (The error was parsed as 10: The repository has been updated since you last pulled. Try pulling before pushing.)
    

    Ideally, the button should look like this if a fetch was performed in the background:
    screen shot 2018-10-23 at 9 52 46 am

    For now, the workaround is still: #2738 (comment) but adding help-wanted if anyone wants to work on this!

  15. added
    help wanted
    on Oct 23, 2018
  16. yalnjooj commented on Jan 3, 2019

    @yalnjooj
  17. shguocc commented on Jan 14, 2019

    @shguocc
  18. self-assigned this
    on Jan 14, 2019
  19. removed
    help wanted
    on Jan 14, 2019
  20. shiftkey commented on Jan 14, 2019

    @shiftkey
    Member

    Bumping this issue to indicate I think I've uncovered the root cause of this flow:

    Now I'm left with only the push option, which doesn't work, so I have to hunt in the menu to find a pull command or use command line.

    Actually, now after about 40 seconds, it changed to "Pull origin" by itself. Guess there might be something wrong with the update of it.

    This feels a lot like something that #6610 will address, and the changes over there should address this so you get immediate feedback after the fetch (and we can change the button label to be Fetch rather than Close).

  21. added this to the 1.7.0 milestone on Jan 22, 2019
  22. CQHofsns commented on Jan 31, 2019

    @CQHofsns

    @copycatx5 I clicked 'undo' underneath the commit button. Then the push button changed to fetched. So i fetched. Commited again. Then pushed.

    You have saved my day, Thank you so much !!! 💯

  23. MappingSteve commented on Feb 24, 2019

    @MappingSteve

    Because this just happened to me, repeating here the work-around for anyone who gets here before the fix rolls out:

    In menu, "Repository > Pull" gets you unstuck.

  24. nguyendptse62666 commented on Feb 27, 2019

    @nguyendptse62666
    1. Click undo dow button Commit to master.
    2. Fetch origin.
    3. Pull new code.
    4. Push your new code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions