Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update switch-to-dev-branch.md #3303

Merged
merged 1 commit into from
Dec 8, 2024
Merged

Update switch-to-dev-branch.md #3303

merged 1 commit into from
Dec 8, 2024

Conversation

ALfuhrmann
Copy link
Contributor

checkout did not work if you did not already have a "dev" branch locally. "git fetch origin dev:dev" fetches and creates local "dev" branch, which can now be switched to. So if you use this script on a new installation, it fails.

Test:

mkdir zigbee2mqtt
git clone --depth 1 https://github.com/Koenkk/zigbee2mqtt.git zigbee2mqtt
cd zigbee2mqtt
git fetch origin dev
git checkout dev # Change 'dev' to 'master' to switch back to the release version

result:

zigbee2mqtt $ git checkout dev
error: pathspec 'dev' did not match any file(s) known to git

"git fetch origin dev:dev" fixes this edge case

checkout did not work if you did not already have a "dev" branch locally.
"git fetch origin dev:dev" fetches and creates local "dev" branch, which can now be switched to
@Koenkk
Copy link
Owner

Koenkk commented Dec 7, 2024

Could you try with git fetch origin instead of git fetch origin dev?

@ALfuhrmann
Copy link
Contributor Author

Could you try with git fetch origin instead of git fetch origin dev?

Like this?

pi@pi:~/test $ git clone --depth 1 https://github.com/Koenkk/zigbee2mqtt.git .
Cloning into '.'...
remote: Enumerating objects: 143, done.
remote: Counting objects: 100% (143/143), done.
remote: Compressing objects: 100% (138/138), done.
remote: Total 143 (delta 7), reused 63 (delta 1), pack-reused 0 (from 0)
Receiving objects: 100% (143/143), 572.27 KiB | 2.54 MiB/s, done.
Resolving deltas: 100% (7/7), done.
pi@pi:~/test $ git fetch origin
pi@pi:~/test $ git checkout dev
error: pathspec 'dev' did not match any file(s) known to git
pi@pi:~/test $

@Koenkk
Copy link
Owner

Koenkk commented Dec 8, 2024

I see, doesn't work indeed. I confirmed your fix, thanks!

@Koenkk Koenkk merged commit befde39 into Koenkk:master Dec 8, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants