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 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
$ git remote -v
origin  https://github.com/AndreyDmitriev39r/Flexbox-practice.git (fetch)
origin  https://github.com/AndreyDmitriev39r/Flexbox-practice.git (push)

$ 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
$ 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

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

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

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

existance(for now, at least).

$ 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

So main conclusion:
if git commands is not useful>>> use some general bash commands?

I can provide some history.

So list of branches was just like now: 4 locals, 4 remotes, all clean.

I ACCIDENTALLY created branch master.

Then i deleted local one:
git branch -d master.

And then I created this thread.

well it was.
Just before all this, i renamed it
first, from master to columnDrop via GitHub website

Then I did this(instruction was provided by GitHub itself)

The default branch has been renamed!
master is now named columnDrop

If you have a local clone, you can update it by running the following commands.

git branch -m master columnDrop
git fetch origin
git branch -u origin/columnDrop columnDrop

$ cat .git/config
[core]
        repositoryformatversion = 0
        filemode = false
        bare = false
        logallrefupdates = true
        symlinks = false
        ignorecase = true
[remote "origin"]
        url = https://github.com/AndreyDmitriev39r/Flexbox-practice.git
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "columnDrop"]
        remote = origin
        merge = refs/heads/columnDrop

$ cat ~/.gitconfig
[user]
        name = NameEdited
        email = email@alsoEdited.com
[color]
        ui = auto
[merge]
        conflictstyle = diff3
[core]
        editor = code --wait

Double-checked.
Nothing like that.

This would mean that all new repos would have default branch master?

thanks for the remainder! I have some articles about this in the bookmarks I believe

Today I was supposed topractice some CSS, but instead learned a bunch of git.
I guess that happens with beginners)

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.