2

After creation of a new project in GitLab CE and pushing a repository on my PC to it with the command:

git push --mirror origin

I've got lots of errors like

(deny updating a hidden ref)

The remote is a corporate GitLab. It exists and is accessible

origin  ssh://git@... (fetch)
origin  ssh://git@... (push)

I simulated the remote by creating a directory on my file system and running in it:

git init --bare

Added this directory as a remote, named it local and retried the initial push with this remote:

git push --mirror local

and it worked. All the branches were copied. So what's the problem with pushing to the corporate remote? Isn't the repo in GitLab created with git init --bare? Are there some settings needed?

The commands that GitLab suggests at the project's page are the following:

    Push an existing Git repository

    cd existing_repo
    git remote rename
    origin old-origin
    git remote add origin ssh://...git
    git push -u
    origin --all git
    push -u origin --tags

but they only seem to push local branches. Does it mean that I have to do:

git checkout -b branch1 other_remote/branch1

for each branch from the other_remote so that they become local and then do the push to the corporate remote with the commands suggested at GitLab project page? This is somehow tedious...

ka3ak
  • 2,435
  • 2
  • 30
  • 57

1 Answers1

0

As in here, check your local config git config --local -l

If you see:

push = +refs/heads/*:refs/remotes/origin/* 

It should be

push = +refs/heads/*:refs/heads/*
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250