Git (Version Control) - Resolve "Your branch is based on but the upstream is gone"

by
Jeremy Canfield |
Updated: August 21 2022
| Git (Version Control) articles
Let's say the git status command returns the following.
~]$ git status
On branch master
Your branch is based on 'origin/master', but the upstream is gone.
(use "git branch --unset-upstream" to fixup)
nothing to commit, working tree clean
This can occur when you have created a new repository using the git init command with the --bare flag and you are adding and commit the very first file to the empty repository. In this scenario, the error should no longer appear after you have committed and pushed the very first file to the new repository.
Did you find this article helpful?
If so, consider buying me a coffee over at
Comments
July 22 2023 by Binod
It's very very Helpful.. Thanks!!
Easy to understand