Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not push - remote: GitLab: You cannot create a branch with an invalid name #512

Open
bfmartins opened this issue Feb 6, 2024 · 0 comments

Comments

@bfmartins
Copy link

I made a cleaning of one file and ok, but can not push. Below the commands in MS Powershell and I have only the master branch.

git clone --mirror https://gitlab.com/xxxxx
java -jar bfg.jar --delete-files filename repo.git

...
Found 499 commits
Cleaning commits: 100% (499/499)
Cleaning commits completed in 1.734 ms.

Updating 5 Refs

    Ref                           Before     After
    -------------------------------------------------
    refs/heads/HEAD             | a2c1ceab | db6e50c0
    refs/heads/master           | 330e156d | ee708fa7
    refs/merge-requests/1/head  | 8222991a | 9339976f
    refs/merge-requests/1/merge | 5a909718 | 39e2072f
    refs/tags/UndoLastCommit    | 0da174f9 | 8f1d0fd0

Updating references: 100% (5/5)
...Ref update completed in 66 ms.

    Earliest                                              Latest
    |                                                          |
    .DDDmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmDDDDDDDD

    D = dirty commits (file tree fixed)
    m = modified commits (commit message or parents changed)
    . = clean commits (no changes to file tree)

    -------------------------------------------
    First modified commit | 686834eb | 8453024c
    Last dirty commit     | 5f65cb3d | 0662fea9

Deleted files

    Filename           Git id
    ------------------------------------------------------
    filename | 4d4b2c9e (187 B ), f8bb534a (92 B )

In total, 845 object ids were changed. Full details are logged here:

    D:\local\2024-02-06\14-59-05

BFG run is complete! When ready, run: git reflog expire --expire=now --all && git gc --prune=now --aggressive

cd repo
git reflog expire --expire=now --all
gc --prune=now --aggressive
Enumerating objects: 17671, done.
Counting objects: 100% (17671/17671), done.
Delta compression using up to 16 threads
Compressing objects: 100% (16830/16830), done.
Writing objects: 100% (17671/17671), done.
Selecting bitmap commits: 429, done.
Building bitmaps: 100% (109/109), done.
Total 17671 (delta 7930), reused 9107 (delta 0), pack-reused 0

PS D:\local\repo.git> git push -f
Enumerating objects: 17671, done.
Writing objects: 100% (17671/17671), 126.32 MiB | 1.11 MiB/s, done.
Total 17671 (delta 0), reused 0 (delta 0), pack-reused 17671
remote: Resolving deltas: 100% (7930/7930), done.
remote: GitLab: You cannot create a branch with an invalid name.
To https://gitlab.com/xxxxxx
! [remote rejected] HEAD -> HEAD (pre-receive hook declined)
! [remote rejected] master -> master (pre-receive hook declined)
! [remote rejected] UndoLastCommit -> UndoLastCommit (pre-receive hook declined)
! [remote rejected] refs/merge-requests/1/head -> refs/merge-requests/1/head (deny updating a hidden ref)
! [remote rejected] refs/merge-requests/1/merge -> refs/merge-requests/1/merge (deny updating a hidden ref)
error: failed to push some refs to 'https://gitlab.com/xxxxx'

Please, help me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant