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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Problems cloning repository from bitbucket to hostinger

When cloning the repository it works without problem, but when deploying to synchronize the versions, the following error message appears.

Deployment start
Repository git@bitbucket.org:quatumted-dev/quatumted-dev1.git
Checking project directory is empty
Project directory is empty
Cloning code repository
fatal: Remote branch master not found in upstream origin
fatal: The remote end hung up unexpectedly

Deployment failed

1 answer

1 accepted

0 votes
Answer accepted

Hi @Quantum TED,

Welcome to the Atlassian Community.

The error message indicate that you do not have a branch called master in your repository, is this a new repository that you have cloned?  Has it been populated with code and pushed back to Bitbucket?

Hi Mikael, thanks for the reply. It is indeed a new and empty repository

Mikael Sandberg Community Leader Sep 18, 2019

Okay, so you need to populate the repository with something before you can run the deployment script. You can either add a .gitignore file or an empty file, anything that creates a commit in the repository and also creates the master branch. Once that is done your deployment script should work.

Like Quantum TED likes this

Thanks again for the help, I was able to solve this step. Now I have another problem. When performing a git push, it prevents me from doing it with this message

remote: permission denied to update the master branch.
To bitbucket.org:quatumted-dev/quatumted-dev1.git
! [remote rejected] master -> master (pre-reception hook rejected)
error: some references could not be sent to 'git@bitbucket.org: quatumted-dev / quatumted-dev1.git'

Captura de pantalla (11).png

Mikael Sandberg Community Leader Sep 19, 2019

Have you added your ssh key to your SSH client? You can check by running this command:

ssh-add -L

If you do not see your key you can add it using this command:

ssh-add <path_to_key>

If you already added the key you can check that the key is associated with the right Bitbucket account by running:

ssh -Tv git@bitbucket.org 

Hi, @Mikael Sandberg 

I did the steps you recommended. I checked the ssh key and this appears to me

-bash-4.2$ ssh-add -L
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9jWKlTGK23W9B6cctFxY2786GlqK9tWht2LW/4SlWnpRAodQyqOmST71ejEvlhFHwwqFI0cO8QGTZXL8ezjo+A8fQK56zYtfIf7vldn2kRLk1jxA2rVvRyukYIdHtrQo2x5+MJl9JbjjeQopF0WLUOGmjIKzmR+98jhup27hAthIQ0oZD659xF8o982QY2+H17MWiv9D345Ya74pCGAbiSYXIA70I/eKsGNNBf1W/k7evxknl8H0PudxGTO+5qBjmeOLSOsyttQpKA3yt8ZUhjDvl4QH3phAL3lAMB07WRMEPGNKuw53qBsV4Vcg7s/TA0j+CxjH4p5HQy3vn7qtd /home/u581521768/.ssh/id_rsa

then, I verified the key associated with the bitbucket account

-bash-4.2$ ssh -Tv git@bitbucket.org
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug1: Connecting to bitbucket.org [2406:da00:ff00::22cd:e0db] port 22.
debug1: Connection established.
debug1: identity file /home/u581521768/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/u581521768/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/u581521768/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/u581521768/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/u581521768/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/u581521768/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/u581521768/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/u581521768/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: Remote protocol version 2.0, remote software version conker_e350bda95a app-133
debug1: no match: conker_e350bda95a app-133
debug1: Authenticating to bitbucket.org:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: curve25519-sha256@libssh.org need=64 dh_need=64
debug1: kex: curve25519-sha256@libssh.org need=64 dh_need=64
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:zzXQOXSRBEiUtuE8AikJYKwbHaxvSc0ojez9YXaGp1A
debug1: Host 'bitbucket.org' is known and matches the RSA host key.
debug1: Found key in /home/u581521768/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/u581521768/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
Authenticated to bitbucket.org ([2406:da00:ff00::22cd:e0db]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
debug1: Sending environment.
logged in as quatumted-dev

You can use git or hg to connect to Bitbucket. Shell access is disabled
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 2728, received 1840 bytes, in 0.0 seconds
Bytes per second: sent 78411.1, received 52887.3
debug1: Exit status 0

finally, I did a push again and the same message from yesterday still appears

 -bash-4.2$ git push origin master
Enumerating objects: 2989, done.
Counting objects: 100% (2989/2989), done.
Delta compression using up to 40 threads
Compressing objects: 100% (2916/2916), done.
Writing objects: 100% (2988/2988), 14.35 MiB | 5.53 MiB/s, done.
Total 2988 (delta 325), reused 0 (delta 0)
remote: Resolving deltas: 100% (325/325), done.
remote: Permission denied to update branch master.
To bitbucket.org:quatumted-dev/quatumted-dev1.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@bitbucket.org:quatumted-dev/quatumted-dev1.git'

 Once again, thanks for your help.

Mikael Sandberg Community Leader Sep 20, 2019

Okay, so this revealed that you have a pre-commit hook that is preventing you from checking in on master, see the second to last line.

In Bitbucket, make sure you do not have a hook configured or branch permission set on master that prevents your push.

Already solved. I realized that the master branch had not assigned permissions. Thank you for all the collaboration, your illustration was very helpful

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,892 views 0 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you