Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Sourcetree can't push problem

EtechSystems January 8, 2018

Dear Support Team 

I have a problem when trying to push , but the pull operation works without problems
You can see the error that appears as follows

 

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=manager-st push -v --tags origin feature/newDesign:feature/newDesign

POST git-receive-pack (815 bytes)

remote: Hook com.atlassian.stash.internal.repository.ref.restriction.RestrictionEnforcer failed. Error:        

remote: bundle [com.atlassian.bitbucket.server.bitbucket-ref-restriction]       

Pushing to http://iyousef@192.168.60.12:7990/scm/ep/zagelwebproject.git

To http://iyousef@192.168.60.12:7990/scm/ep/zagelwebproject.git

! [remote rejected] feature/newDesign -> feature/newDesign (pre-receive hook declined)

error: failed to push some refs to 'http://iyousef@192.168.60.12:7990/scm/ep/zagelwebproject.git'

Completed with errors, see above.

 

Please provide me with any information to resolve the problem

Best Regards 

21 answers

6 votes
Kuba Borucki
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!
January 14, 2019

For anyone still stuck, I managed to resolve this by going to manage windows credentials (control panel->user accounts->credential manager) and deleting anything with bitbucket.org mentioned in the name under the generic credentials section. I.e. it might look like "git:https://username@bitbucket.org"

I also deleted all the accounts in sourcetree under tools-->options-->authentication (think I did that first) Not sure this step is required.

Now working OK again

Laoky
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 1, 2019

THANKS !

FrancescoFidecaro
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!
November 11, 2019

There was some hg:https://username@bitbucket.org in the generic windows credentials.

Sounds like removing it made it work. Thanks!

Like Jenna likes this
Kaung Thu Khant
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!
July 17, 2020

how about for mac?

Like Marcelo Lotif likes this
3 votes
Deleted user February 11, 2020

This is my workaround, try updating your embedded git or if you have a local installation of git in your system try using it instead of the embedded one.

To update, just click the Update Embedded button under Git Version.

In switching to System, just click the System button under Git Version.

You can find this in, Sourcetree -> Tools -> Options -> Git.

Hope this helps.

forevermatt
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!
July 12, 2020

Updating my embedded copy of Git and telling SourceTree to use that fixed the problem for me. Thanks! (My symptom was that when I pushed the "Push" button within SourceTree, there were no branches listed in the Push dialog, so I wasn't able to select anything to push.) It now works fine, though.

VetVR
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!
November 15, 2020

Updating Embedded Git worked for me.  Thanks for the tip. :)

1 vote
shravyakancharla
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 7, 2020

If anyone is still looking for a solution, this helped me.

Click on 'Terminal' button in the Source Tree UI, and run

git pull --tags


1 vote
Maikuolan
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!
January 14, 2019

Not really a true "solution" to the *root* of the problem being discussed, but in my case, since my previous reply to this discussion, I've long since just been going about all my Git-related business via Git bash, which has worked out perfectly for me.

Would be great to be able to use SourceTree as intended, but until such a time comes, I'll just continue using Git bash (which has thus far worked perfectly for me, without any major problems) to interact with BitBucket (plus any other Git-related services and platforms).

Sharing this information, not to have a go at SourceTree, nor to complain, but simply because it might indicate a possible solution for others in the same situation as my own (in the sense that maybe that hadn't yet considered using Git bash to handle all their Git-related business).

(Also, AFAICT, the root of the problem is definitely SourceTree, and neither BitBucket itself nor anything else at Atlassian's side of things. I say this, because although I've experienced the issue being discussed with SourceTree before, I've never actually experienced any problems wih BitBucket itself before).

1 vote
Jake Yang
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!
February 14, 2018

Greeting, 

I just updated sourcetree to the latest (2.7.1) and I can't perform push command anymore. pull command seems fine. 

I'm able to push through terminal, seems like it's a bug from the new update.

 

Jake

1 vote
Katagena
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!
January 17, 2018

It's seem that i have got the same problem.

 

Since the update i am not able to push my code to my bitbucket account.

I can push from command line.

ssh -Tv git@bitbucket.org

works fine too. It's seems to be just on Sourcetree. 

0 votes
akakshepati
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!
December 7, 2020

I managed to solve the issue by deleting the file:
../Users/<name>/Appdata/Local/Atlassian/SourceTree/passwd

When pushing i was prompted for a password and the above file is recreated.

0 votes
phineas carberry
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 18, 2020

I FINALLY FIXED IT (Working for other members of the team too)

First i went to programs and clicked uninstall for source tree

Second i deleted the folder Drive/Users/Yourname/Appdata/Local/Atlassian

Third i reinstalled it, clicked the embed option for the thingy and added my git project back with the add button. 

Fourth I went to settings, clicked on the project, clicked edit, then changed the remote account to my actual account instead of the generic one.

Lastly I clicked pull and push (actually went through)!

 

 

Before I was only able to pull through source tree but not push, I could still however push through command line.

0 votes
Ben February 23, 2020

Great, I have the same problem. Tryed to remove all credentials in Windows and references.

OK, Atlassian can't solve the issue.

This has a history of 2 years, lets go back to the commandline again with Git.

0 votes
Erik Hoglid
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!
January 9, 2020

Have the same issue. For me it doesn't work because we use 
push = refs/heads/*:refs/for/*
in the config file under .git folder. 
https://stackoverflow.com/questions/10461214/why-is-git-push-gerrit-headrefs-for-master-used-instead-of-git-push-origin-mast

Looks like this doesn't work after SourceTree 3.1.2

0 votes
davejohnson
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!
January 14, 2019

It's January 2019 any answers to this?

0 votes
Devin
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!
December 14, 2018

I am also have the same problem.

0 votes
Kuba Borucki
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!
December 11, 2018

Also can't push or pull. Anyone found a solution?

0 votes
oscarzhou
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!
December 3, 2018

The same issue happened to me since yesterday, but I still can push by cli. However, it didn't work on both sides now. 

0 votes
marcelino_borges
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 28, 2018

SAME HERE!!!!!!!!!!

How can i push afterall???

0 votes
analogknight
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 13, 2018

Similar issue. Push from command line says all is up to date, but viewing source code online shows old source. Local files are not changed, but I can see the changes when double-clicking to edit a file from Sourcetree.

0 votes
alex_zanis
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 5, 2018

Same issue. 

0 votes
Maikuolan
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 5, 2018

Hi,

I can confirm that I'm also experiencing this problem currently. I'm using the latest version of SourceTree.

Looking forward to hearing what solutions can be recommended.

Cheers.

0 votes
ngoctai June 5, 2018

Dear Support Team,

I have the same problem.

I can't push and pull from sourcetree 2.7.4 with Bitbucket Cloud and MacOS.

I  can push from command line but it's inconvenient.

Please help me

Ryo.

0 votes
Osman Veledar
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!
February 23, 2018

Getting Push/Pull errors as well. Running 2.4.8.0 on Windows. Command line works.

0 votes
Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 9, 2018

Hi Rula, have you tried pushing from the command line too? If you get the same error from the command line, then the issue is not related to Sourcetree and we'll need to figure out what's going on.

Can you also let us know where are you pushing to? Is it Bitbucket Server? Or Bitbucket Cloud? Or Github...?

Regards,

Ana

EtechSystems January 9, 2018

Dear Ana 

this problem appear when i try push code from Sourcetree to Bitbucket server  

Best Regards

asmarkis
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!
February 23, 2018

------

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events