Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

its about disappearing new branches plus The main itself

Last Try Before solving Problem: shows the line which dont recognition the Mother Branch

four first lines of code

Here is The Code:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

First i initialized a repo:

   $ git init

then renamed Master to Mother:

$ git branch -m "Mother"

created a readme.md:

 $ touch "readme.md"

The First error when i tried to create a new branch then, I got caught in it was(exactly is shown in the first image):

 $ git branch Product
    
    fatal: not a valid object name: 'Mother'

after creating several branches by alt:

   $ git checkout -b Product
    
    Switched to a new branch 'Product' 

and commiting the readme.md file..

i tried to switch to The previously created branches but the main question is here:

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

this even happened for my Root:

$ git checkout Mother

error: pathspec 'Mother' did not match any file(s) known to git

so i recreated those branches again:

  $ git checkout -b Product
    
    Switched to branch 'Product'

The Problem Solved but whats the reason behind it

may you tell me why?

new edit: ‘im intern’

>Solution :

Branches in Git are pointers to existing commits. When you init, your repository has 0 commits, thus you cannot create any branches. Once you have a commit, you can create new branches.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading