1

I have created an empty repository on Bitbucket server (run in a Docker container and exposed by NGINX - also run via Docker container) for a Project in a network isolated machine. While setting it up I have come accross the following error:

![remote rejected] master -> master (shallow update not allowed) error: failed to push some refs to

I have the repo and code locally and followed the procedures bellow:

git config --global user.name "<user>"
git config --global user.email "<user.email>"

git clone <url bitbucket repo path>

cd project-code-folder
git init
git add --all
git commit -m "initial commit"
git remote add origin <url bitbucket repo path>
git push -u origin master

The error happens when I execute the last instruction, so I am not able to import my local code into the Bitbucket repo. How can I solve this?

1

1 Answer 1

0

So, after a lot of testing, I found out that althouth the repo url (origin) was correct and everything was well configured the parameter proxy_path on the NGINX config file did not match the dns that I had defined for Bitbucket server access -> server-name.

server {
    listen 443;
    server_name <server-name>;
    add_header X-Frame-Options ALLOW;

    location /bitbucket {
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass <https://server-name:7990/>;
        proxy_connect_timeout 300;
    }
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/HTML;
    }
}

After coorrecting it and adding the parameter client_max_body_size 500M; to the config file (to avoid error 413: Entity too large), I was able to migrate the repo successfully.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .