2

There is a commit that has no branch in GitLab, which I can see and open in GitLab. It appears in the activities tab. But, I can't figure out how to get it back in a local branch or delete it anyway.

I tried already a lot but I couldn’t find a topic which describes how I can get or delete a commit (without branch) that is only available on the remote repository. I tried git show HASH and I tried to display dangling commits and searched for unreachable objects but it didn't showed the commit locally whatsoever. In the repository I can also see the parent from the dangling commit and I tried to set the HEAD back to this parent, but I still didn't find this commit.

Can you help me please? I’m not so experienced with Git/GitLab so if you need more information you just have to ask.

das-g
  • 9,718
  • 4
  • 38
  • 80
Perry45
  • 66
  • 7
  • Might be related to [link](https://stackoverflow.com/questions/3765234/listing-and-deleting-git-commits-that-are-under-no-branch-dangling) – Emilio Miralles Jul 14 '18 at 00:12
  • 1
    Is that commit tagged? If not, the fact that it is displayed on GitLab may just be a bug in GitLab. (Or maybe something that GitLab does deliberately for whatever reason, but not directly related to Git in general.) – das-g Jul 14 '18 at 09:25
  • @EmilioMirallesThanks for answer, but the difference is I cant show the commit with git show HASH like the author of that question No, the commit is not tagged. The problem is, the commit has my password in it, which I committed accidentally. I thought luckily I had another branch which was same "state", so I delete the branch with the wrong commit and cloned that other branch. Well it's not that worse, because only project member of my company have access to this project and the commit can only be found in the activity log, but its still somehow pity. – Perry45 Jul 14 '18 at 12:27
  • @Perry45 your password was already compromised. Change the password immediately (well, 4 years later) and move on. – knittl Oct 19 '22 at 08:29

0 Answers0