Skip to content

Commit 918470a

Browse files
committed
Closes #19208: Ignore beta releases when fetching latest release tag
1 parent c73cc0a commit 918470a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

docs/installation/upgrading.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,19 @@ sudo cp /opt/netbox-$OLDVER/gunicorn.py /opt/netbox/
124124

125125
### Option B: Check Out a Git Release
126126

127-
This guide assumes that NetBox is installed at `/opt/netbox`. First, determine the latest release either by visiting our [releases page](https://github.com/netbox-community/netbox/releases) or by running the following `git` commands:
127+
This guide assumes that NetBox is installed at `/opt/netbox`. First, determine the latest release either by visiting our [releases page](https://github.com/netbox-community/netbox/releases) or by running the following command:
128128

129129
```
130-
sudo git fetch --tags
131-
git describe --tags $(git rev-list --tags --max-count=1)
130+
git ls-remote --tags https://github.com/netbox-community/netbox.git \
131+
| grep -o 'refs/tags/v[0-9]*\.[0-9]*\.[0-9]*$' \
132+
| tail -n 1 \
133+
| sed 's|refs/tags/||'
132134
```
133135

134-
Check out the desired release by specifying its tag:
136+
Check out the desired release by specifying its tag. For example:
135137

136138
```
137-
sudo git checkout v4.2.0
139+
sudo git checkout v4.2.7
138140
```
139141

140142
## 4. Run the Upgrade Script

0 commit comments

Comments
 (0)