3

I'm trying to import a Git repository using the command-line. I'm using this guide

But I keep running into this error at Step 3:

% git push --mirror https://github.com/kbavishi/prads.git
[...]
remote: error: GH002: Sorry, branch or tag names consisting of 40 hex characters are not allowed.
remote: error: Invalid branch or tag name "19f72fa66ffc0ba33f00ba5e5897e109f822e939"
To https://github.com/kbavishi/prads.git
! [remote rejected] 19f72fa66ffc0ba33f00ba5e5897e109f822e939 -> 19f72fa66ffc0ba33f00ba5e5897e109f822e939 (pre-receive hook declined)
[...]

Any idea how to fix this? Apologies in advance, I'm a newbie to Git.

I posted a request on Github support, and I received a response asking me to use git-filter-branch command to amend the tag, and then try importing the repository again. I couldn't quite figure out how to use that

karan
  • 31
  • 2

1 Answers1

2

If, when typing git tag, you see a tag named "19f72fa66ffc0ba33f00ba5e5897e109f822e939", you should be able to rename it easily enough.

git tag NEW OLD 
tag -d OLD

If it is a branch name (type git branch), you should be able to rename it as well.

git branch -m <oldname> <newname>

Once this is done, you can mirror push back to your GitHub repo.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250