Geoff_S
Geoff_S

Reputation: 5107

Resolve Push/Pull on branch

I've been messing with this for a while and can't seem to resolve this, but I have push and pull pending on my master branch and can't seem to resolve either.

Here is an image, before I go through what I did:

enter image description here

So, I created the f-Unused_alert_zips branch to do a pull request for 2 deleted files. This was approved and I merged the pull request into master through bitbucket. Then I came back to sourcetree and swithced my active branch back to master. I made a code comment in a file and wanted to just commit/push straight to master but It wouldn't allow it because I needed to pull changes. Apparently I did it wrong because now I'm left with 4 pulls pending and 1 push pending. I've tried and tried but I'm stuck.

I'm very new to git and sourcetree/bitbucket, so I'm grasping at straws.

Upvotes: 1

Views: 3483

Answers (1)

Oleksandr Pryimak
Oleksandr Pryimak

Reputation: 1581

I guess the commit "Modified code comment with date to show relevance" is authored by you (I guess that's what you've done while waiting for your pull request to be merged)

I also guess that the expected behavior is to see your master's commit on top of origin/master

It is easy to archive with

git pull --rebase

You may need to resolve conflicts. Don't worry. If you see that the conflicts are hard to resolve you always undo your pull --rebase by issuing git rebase --abort

If you want to be on the safer side you can split your git pull --rebase into three steps

  1. git fetch --all It is always safe. It just fetches all new data from remote repositories
  2. git log master --not origin/master shows commits which you have but which are not present in remote repository
  3. git rebase origin/master (I assume you are currently on the master branch)

If something goes wrong you can issue git rebase --abort

Upvotes: 3

Related Questions