Documentation to change Git configuration to use "Main" instead "Master" - Unable to update Netbox #11612

Closed
opened 2025-12-29 21:47:38 +01:00 by adam · 7 comments
Owner

Originally created by @CBrown-Networking on GitHub (Sep 15, 2025).

Change Type

Addition

Area

Installation/upgrade

Proposed Changes

I am currently running NetBox Community Version 4.2.6. I am trying to upgrade to version 4.4.0 but I am running into a git related issue. I am entering the commands that are provided in the documentation but I am getting an "fatal: couldn't find remote ref refs/heads/master" error. Here is the output:

scjbadmin@svp019app:/opt/netbox$ git ls-remote --tags https://github.com/netbox-community/netbox.git | grep -o 'refs/tags/v[0-9].[0-9].[0-9]*$' | tail -n 1 | sed 's|refs/tags/||'
v4.4.0

scjbadmin@svp019app:/opt/netbox$ cd /opt/netbox && sudo git fetch --tags && sudo git checkout v4.4.0
[sudo] password for scjbadmin:
fatal: couldn't find remote ref refs/heads/master
scjbadmin@svp019app:/opt/netbox$

Here is the output from git config file on the server:

scjbadmin@svp019app:/opt/netbox/.git$ cat config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = https://github.com/netbox-community/netbox.git
fetch = +refs/heads/master:refs/remotes/origin/master
[branch "master"]
remote = origin
merge = refs/heads/master

Originally created by @CBrown-Networking on GitHub (Sep 15, 2025). ### Change Type Addition ### Area Installation/upgrade ### Proposed Changes I am currently running NetBox Community Version 4.2.6. I am trying to upgrade to version 4.4.0 but I am running into a git related issue. I am entering the commands that are provided in the documentation but I am getting an "fatal: couldn't find remote ref refs/heads/master" error. Here is the output: scjbadmin@svp019app:/opt/netbox$ git ls-remote --tags https://github.com/netbox-community/netbox.git | grep -o 'refs/tags/v[0-9]*\.[0-9]*\.[0-9]*$' | tail -n 1 | sed 's|refs/tags/||' v4.4.0 scjbadmin@svp019app:/opt/netbox$ cd /opt/netbox && sudo git fetch --tags && sudo git checkout v4.4.0 [sudo] password for scjbadmin: fatal: couldn't find remote ref refs/heads/master scjbadmin@svp019app:/opt/netbox$ **Here is the output from git config file on the server:** scjbadmin@svp019app:/opt/netbox/.git$ cat config [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] url = https://github.com/netbox-community/netbox.git fetch = +refs/heads/master:refs/remotes/origin/master [branch "master"] remote = origin merge = refs/heads/master
adam added the type: documentationpending closurestatus: revisions needed labels 2025-12-29 21:47:38 +01:00
adam closed this issue 2025-12-29 21:47:38 +01:00
Author
Owner

@jeremystretch commented on GitHub (Sep 16, 2025):

What specifically are you proposing be added or changed in the documentation?

@jeremystretch commented on GitHub (Sep 16, 2025): What specifically are you proposing be added or changed in the documentation?
Author
Owner

@CBrown-Networking commented on GitHub (Sep 16, 2025):

What specifically are you proposing be added or changed in the documentation?

Documentation on updating the git config file to use "main" instead of "master" for future upgrades via the Git method. I think this should be added to the upgrade section of the documentation.

@CBrown-Networking commented on GitHub (Sep 16, 2025): > What specifically are you proposing be added or changed in the documentation? Documentation on updating the git config file to use "main" instead of "master" for future upgrades via the Git method. I think this should be added to the upgrade section of the documentation.
Author
Owner

@pinedriley commented on GitHub (Sep 18, 2025):

I'm having the same issue. Did you find a workaround to upgrade?

@netbox:/opt/netbox$ sudo git fetch
[sudo] password for administrator:
fatal: couldn't find remote ref refs/heads/master

@pinedriley commented on GitHub (Sep 18, 2025): I'm having the same issue. Did you find a workaround to upgrade? @netbox:/opt/netbox$ sudo git fetch [sudo] password for administrator: fatal: couldn't find remote ref refs/heads/master
Author
Owner

@CBrown-Networking commented on GitHub (Sep 18, 2025):

Yes, I had to change the keyword "master" to "main" in the .git config file.
File path: /opt/netbox/.git
File name in path: config

Contents of the the "config" file:

[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = https://github.com/netbox-community/netbox.git
fetch = +refs/heads/master:refs/remotes/origin/master
[branch "master"]
remote = origin
merge = refs/heads/master

@CBrown-Networking commented on GitHub (Sep 18, 2025): Yes, I had to change the keyword "master" to "main" in the .git config file. File path: /opt/netbox/.git File name in path: config Contents of the the "config" file: [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] url = https://github.com/netbox-community/netbox.git fetch = +refs/heads/master:refs/remotes/origin/master [branch "master"] remote = origin merge = refs/heads/master
Author
Owner

@github-actions[bot] commented on GitHub (Sep 26, 2025):

This is a reminder that additional information is needed in order to further triage this issue. If the requested details are not provided, the issue will soon be closed automatically.

@github-actions[bot] commented on GitHub (Sep 26, 2025): This is a reminder that additional information is needed in order to further triage this issue. If the requested details are not provided, the issue will soon be closed automatically.
Author
Owner

@lingfish commented on GitHub (Oct 3, 2025):

What specifically are you proposing be added or changed in the documentation?

Documentation on updating the git config file to use "main" instead of "master" for future upgrades via the Git method. I think this should be added to the upgrade section of the documentation.

I've just hit this, and I completely agree. The internet is full of varying methods to fix this, and I'm pretty sure @CBrown-Networking modifying git config files isn't the right way.

@lingfish commented on GitHub (Oct 3, 2025): > > What specifically are you proposing be added or changed in the documentation? > > Documentation on updating the git config file to use "main" instead of "master" for future upgrades via the Git method. I think this should be added to the upgrade section of the documentation. I've just hit this, and I completely agree. The internet is full of varying methods to fix this, and I'm pretty sure @CBrown-Networking modifying `git` config files isn't the right way.
Author
Owner

@jeremystretch commented on GitHub (Oct 3, 2025):

Closing this out as stale as no one has proposed a specific change to the documentation.

@jeremystretch commented on GitHub (Oct 3, 2025): Closing this out as stale as no one has proposed a specific change to the documentation.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11612