Forum Discussion

Stalsy's avatar
Stalsy
Contributor
4 years ago

Branch is ahead by n commits but Push button is disabled

I have integrated Git with ReadyAPI 3.5.1 and set up a local master and a remote origin/master.  I did this with a test project and all was well.  Then I added another project and since then, I can commit to the local master but the push button remains disabled so I can't use it.  Currently (see Git.png) when I click on the Git icon it says that my local master is 7 commits ahead and the disabled Push button displays "Push (7)".  How do I get the Push button 

2 Replies

  • richie's avatar
    richie
    Community Hero
    Hey Stalsy,

    Im not an expert and i only used git with readyapi! briefly so i cant help from a readyapi! perspective, but i think your push button isnt enabled cos your remote changes are ahead of yours.
    If you open a git command line terminal you could do following:

    1. Make sure you navigate to your relevant checkout branch
    2. Run 'git stash' (stashes off your local changes)
    3. 'git pull' (pulls down the remote changes)
    4. 'git stash pop' (which unstashes your local changes)

    At this point id restart your readyapi instance. Your local branch should be the same as your remote branch (except your local changes) so i reckon your push button should be available at this point.

    Ta

    Rich
    • Stalsy's avatar
      Stalsy
      Contributor

      Hi Rich, I did what you suggested and after restarting ReadyAPI I committed but nothing changed.  The Push button is still disabled and the "Branch is ahead by n commits" message was still there.  I did a few more changes, closed ReadyAPI, repeated the steps that you suggested and added a "git push".  When I do "git status" I get "On branch master. Your branch is up-to-date with 'origin/master'" and if I repeat "git push" I get "Everything up-to-date".  Inside ReadyAPI the Pull Changes button became enabled and when I clicked it I got an error pop-up "Unable to pull changes because local and remote projects are different projects"

      So I had a look at Integrations/Git/Manage/Test Connection.  In this form there are 2 "Test Connection" buttons, one for my test project and one for my real project and both of them point to the same remote: ssh://git@stash:7999/racqatf/openbanking.git

      When I click on each of the "Test connection" buttons I get "Successfully connected".  I went on to deleted the Git account and re-create it and re-attach my project to it, but I still get the same message "Unable to pull changes because local and remote projects are different projects" and still "Branch is ahead by n commits"!