Error encountered on Source Tree - git log failed with code 128

cyberpunkstudio
Contributor
October 8, 2012

When I clone a Git repo in Source Tree and make a commit and then go to Master branch to try and push my code to Bit Bucket, I get this error:

'git log' failed with code 128:'fatal: ambiguous argument 'origin/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions

Please see screen shot:
https://dl.dropbox.com/u/119654/Support/Atlassian/Screen%20Shot%202012-10-09%20at%2016.39.03.png

This has been happening recently whenever I create a new repo and then initiate first commit. Seems to throw this error everytime. I'm not sure why as I haven't changed anything.

Currently running Mac 10.7.5 and Source Tree 1.5.4. and have Git 1.7.5.4 on my Mac.

8 answers

1 accepted

2 votes
Answer accepted
stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 8, 2012

Hmm, that's odd - it looks like something has happened to the definition of the remote branch 'origin/master'.

Can you try this:

  • Click 'Fetch' on the toolbar
  • Leave 'Fetch from all remotes' checked
  • Check 'Prune tracking branches no longer present on remote(s)'
  • Click OK

cyberpunkstudio
Contributor
October 8, 2012

Thanks that fixed it. Not sure why that happened in the first place

stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 8, 2012

This kind of thing usually only happens if someone deletes branches from the remote, or forces a push which changes commits that someone else has pulled. Beause git fetches this from the remote and stores it, if it changes it can get confused unless you prune the remote info like this. You shouldn't need to do it normally.

cyberpunkstudio
Contributor
October 8, 2012

Strange because, I only just created this new repo and no one else is working on it. I did the first commit and then it came up with that problem. There wasn't any remote branches setup

Aravind Rangoju
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 2, 2013

I still see this problem, I wasn't able to fix this by tip given by @Steve. Please suggest a workaround for this.

eiger3970
Contributor
July 12, 2015

Hello, I still receive the error 128.

5 votes
serpulga
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 11, 2014

I fixed by removing from bookmarks, opening the repo from File -> Open, and saving to bookmarks again.

isral duke
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 21, 2015

This helped me. Thanks.

Like shooding likes this
shooding
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 30, 2019

Worked like a charm ! File -> Open is the key !

2 votes
Frédéric MARTINEZ December 10, 2014

Your upstream is gone.

Try this:

git branch --unset-upstream
guntherfitzgibbons
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 24, 2016

thanks - this fixed the issue

Like cvlug likes this
2 votes
serpulga
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 16, 2014

This is happening everytime a delete a branch, even if I don't push it to a remote.

2 votes
Aran Wilkinson
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 15, 2014

I am getting this issue, I'm using git flow and just finished with a feature branch, merged it into develop, removed my old feature branch and now get that error message everytime I change branch or load up the window with the graph it errors.

1 vote
Shane Parsons
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 8, 2018

None of this worked for me... any ideas?

1 vote
Aravind Rangoju
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 30, 2013

I still this problem, I wasn't able to fix this by tip given by @Steve. Please suggest a workaround for this.

0 votes
eiger3970
Contributor
July 12, 2015

I tried the Fetch thingy and also$ git branch --unset-upstream, but same error 128.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events