Unable to delete a branch by using git branch -d xfusioncorp_games

Nautilus developers are actively working on one of the project repositories, /usr/src/kodekloudrepos/games. They were doing some testing and created few test branches, now they want to clean those test branches. Below are the requirements that have been shared with the DevOps team:

On Storage server in Stratos DC delete a branch named xfusioncorp_games from /usr/src/kodekloudrepos/games git repo.

for this task, I recieved the following error

fatal: not a git repository (or any of the parent directories): .git

the steps I followed here are

ssh natasha@ststor01

sudo su -

git branch -d xfusioncorp_games

Can anyone please help me on this task

You will get this error if you are not in a directory that contains a git repo.

You can know if you are as the root of any repo contains the directory .git

ls -la

drwxr-xr-x  8 bob bob  4096 Oct 13 08:34 .git

1 Like

Thank you! Yes I was in the directory that contains a git repo.