How to create a Orphan Branch in SourceTree?

In SourceTree you can create branches with no problem, but how do you create a Orphan branch?

2 answers

1 accepted

I was researching this the other day, and couldn't find an answer to it either. Best bet is to do it from the command line. In sourcetree, click on terminal, then run git checkout --orphan NEWBRANCH.

Additional info: after running 

git checkout --orphan <NEWBRANCH>

You can run 

git rm -rf .

to clear the index and the working tree right after creating the orphan branch.

I do not believe SourceTree provides a way to do this in the UI. I imagine usage of "orphan" branches is so rare that if they DID support it, they would have more people using it on accident and panicking ("WHERE DID MY FILES GO?!?!?!?!1111") than they would have people using it on purpose.

Additionally, the required command is so simple, it doesn't really add a huge burden to those of you who have a legitimate use.

such people should not use git.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

798 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you