Home > Enterprise >  git checkout master does not work after i created a branch....what can I do?
git checkout master does not work after i created a branch....what can I do?

Time:10-25

I have created a file called basic and I have created a branch called new. After moving to the new branch, I want to switch to the master branch, hence i used git checkout master. Unfortunately, the terminal stated there is no master branch.

(base) Dun-Yan:basic ongdunyan$ git checkout master
error: pathspec 'master' did not match any file(s) known to git

Here is the git status:

(base) Dun-Yan:basic ongdunyan$ git status
On branch new
nothing to commit, working tree clean

I would appreciate if you all can help me, peace :)

CodePudding user response:

This means that, yes indeed, there is no branch named master. There's no requirement that any Git repository have any particular branch names—you can have a repository with no branch names at all—so that's not an error, unless of course you want it to be one.

  • Related