Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Persistent error when creating branch

School-learner November 15, 2019

My udemy tutorial did a bad job by giving poor guidance. Youtube don't have any proper examples. I keep getting this error message. See screenshot. I have tried reinstalling source tree and it persist. Is this by bad design or do i need to install anything else? i have tried different names and it just refuse to work. What's happening? 

 

error creating branch.JPG

1 answer

0 votes
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 18, 2019

Is this your first commit in the repository? Is so, Git will automatically create the master branch for you. Once your repository have at least one commit in it you can create new branches.

School-learner November 18, 2019

Hi Mikael,

Yes, the first commit and push both have error messages. Is this normal? If this is normal, then the error message is questionable. I followed the tutorial in another youtube video. I noticed that after i committed and pushed, the branch was created. So why does the error message appear?

School-learner November 18, 2019

Update: I've tried many more times and suddenly, the error disappeared. I have filed a bug report. I hope this can be investigated. Now sourcetree can create another branch even though my git commands are not complete. Why is this?

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 19, 2019

The error you first saw is expected, Git will not allow you to create a new branch until you have done a commit. The initial commit will create the master branch and once that is done Git will allow you to create a new branch. Branches in Git are just pointers to a commit, so if your repository is empty, there is no commit to point to.

What do you mean with that your git commands are not complete?

School-learner November 19, 2019

Ignore what I stated. I have opened another ticket as it suddenly worked without any reason/ explanation. See the next ticket I opened. It looks more like a bug now.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events