Git/Github. Need to get rid of some remote

Git bash situation right now.

Матрос Дмитриев (columnDrop) flexBoxDesignPatterns
$ git branch -a
* columnDrop
  layoutShifter
  mostlyFluid
  offCanvas
  remotes/origin/columnDrop
  remotes/origin/layoutShifter
  remotes/origin/master
  remotes/origin/mostlyFluid
  remotes/origin/offCanvas
Матрос Дмитриев (columnDrop) flexBoxDesignPatterns
$ git push origin --delete master
error: unable to delete 'master': remote ref does not exist
error: failed to push some refs to 'https://github.com/AndreyDmitriev39r/Flexbox-practice.git'

I wanna get rid of remotes/origin/master.
It is not present in remote repo
But it exists in list of remote branches.
Little bit confused what should I type in bash right now.

I believe the command would be git push -d origin master Why are you wanting to remove your master branch (most use main now).

I have some improvised branching strategy for this one. Just to play around git for practice.
In other projects I am trying to use more common practises

$ git push -d origin master
error: unable to delete 'master': remote ref does not exist
error: failed to push some refs to 'https://github.com/AndreyDmitriev39r/Flexbox-practice.git'

This didn’t work.
This below didn’t work also:

$ git push -d origin/master
fatal: --delete doesn't make sense without any refs

Type git remote -v and let me know what it shows.

$ git remote -v
origin  https://github.com/AndreyDmitriev39r/Flexbox-practice.git (fetch)
origin  https://github.com/AndreyDmitriev39r/Flexbox-practice.git (push)

Try git fetch --prune origin

$ git fetch --prune origin
error: Unable to create 'C:/freecodecamp/Responsive Web Design/flexBoxDesignPatterns/.git/packed-refs.lock': Permission denied
error: could not remove reference refs/remotes/origin/master
From https://github.com/AndreyDmitriev39r/Flexbox-practice
 - [deleted]         (none)     -> origin/master
Матрос Дмитриев (columnDrop) flexBoxDesignPatterns
$ git branch -a
* columnDrop
  layoutShifter
  mostlyFluid
  offCanvas
  remotes/origin/columnDrop
  remotes/origin/layoutShifter
  remotes/origin/master
  remotes/origin/mostlyFluid
  remotes/origin/offCanvas

How about just:
git remote prune origin

$ git remote prune origin
error: Unable to create 'C:/freecodecamp/Responsive Web Design/flexBoxDesignPatterns/.git/packed-refs.lock': Permission denied
error: could not remove reference refs/remotes/origin/master
Pruning origin
URL: https://github.com/AndreyDmitriev39r/Flexbox-practice.git
 * [pruned] origin/master
Матрос Дмитриев (columnDrop) flexBoxDesignPatterns
$ git branch -a
* columnDrop
  layoutShifter
  mostlyFluid
  offCanvas
  remotes/origin/columnDrop
  remotes/origin/layoutShifter
  remotes/origin/master
  remotes/origin/mostlyFluid
  remotes/origin/offCanvas

Let’s check something.

type ls -al

to make sure: ls -al or ls -all?

ls -al is the command

Both of ls-al and ls -all gave the same output by the way

$ ls -al
total 20
drwxr-xr-x 1 Матрос Дмитриев 197121    0 Jul 13 20:50 ./
drwxr-xr-x 1 Матрос Дмитриев 197121    0 Jul 11 22:23 ../
drwxr-xr-x 1 Матрос Дмитриев 197121    0 Jul 13 21:57 .git/
-rw-r--r-- 1 Матрос Дмитриев 197121 1236 Jul  7 01:29 index.html
-rw-r--r-- 1 Матрос Дмитриев 197121 1917 Jul 13 20:50 styles.css

Seems like you have permission to update files in the .git folder. I will have to research a bit more on this one.

I would like to mention that this problem is not serious at all. I can deal with this

existance(for now, at least).

It bothers me when I can’t do something in Git. :grin:

Do this:

ls .git/refs/remotes/origin
$ ls .git/refs/remotes/origin
columnDrop  layoutShifter  master  mostlyFluid  offCanvas

So now we will delete it with command line from directory?)

That should work.

rm .git/refs/remotes/origin/master

Hazzah!

$ rm .git/refs/remotes/origin/master
Матрос Дмитриев (columnDrop) flexBoxDesignPatterns
$ git branch -a
* columnDrop
  layoutShifter
  mostlyFluid
  offCanvas
  remotes/origin/columnDrop
  remotes/origin/layoutShifter
  remotes/origin/mostlyFluid
  remotes/origin/offCanvas